A solution would be to only wrap the <form runat="server"> </form> around the area that you need it, instead of around the whole masterpage.
I usually just wrap the bodyText page field in the templates with the form tag if authors are to insert forms themselves, otherwise I just wrap the form around the actual doc2form macro code in the template
I am not sure if I did it correctly. Because there will be at least two forms on the same page. Will this then mean that I should add two <form runat="server"></form> tags?
Ah now I see what you do - one of them is a standard html form (both are not asp.net forms)
Which is why it allows you to have two form tags.
This solution will not work as both were asp.net controls however after I changed the search box to regular html form controls (then it could work of cause) it works with both forms in the same form tag.
Thanks Chris, it was rather helpful and actually found that it was excactly the same thing Dan wrote (thanks to both, and I think I will opt for that solution because it will spare me the js).
Hmm...I have removed the server form and attached the form-tag around the two forms I have on my site...
But it does not really work very smooth...
On my page I have a subscription form and an unsubscription form - This only happens when a visitor goes to the "unsubscription" page since the subscription form is a global element on the site.
If one for some reason enters the website through the unsubscription and actually want's to subscribe for the newsletter then the e-mail entered appears on the unsubscription form field once I hit submit.
How can I solve this? I guess I'm missing something obvious but I just can't seem to get my mind right...
Two forms on the same page
I almost seems to be a classic right - but it ain't I think.
I have the following code in my master template
The doc2form works on frontpage only and not on subpages.
If I remove the search box entirely it will work on subpages as well.. How do I fix this?
Thanks.
Oh almost forgot:
UV: 4.0.2.1
ANV: 2.0
WAIV: 2003/IIS6
S: nothing
ADDOWYDBTIH: above :)
Hi Again :-)
A solution would be to only wrap the <form runat="server"> </form> around the area that you need it, instead of around the whole masterpage.
I usually just wrap the bodyText page field in the templates with the form tag if authors are to insert forms themselves, otherwise I just wrap the form around the actual doc2form macro code in the template
Dan
Hiya back :)
I am not sure if I did it correctly. Because there will be at least two forms on the same page. Will this then mean that I should add two <form runat="server"></form> tags?
Scott
Okay, well I solved it by using javascript which I think is totally crazy - however I did this:
So that the search box is using javascript.
When clicking enter on that box it will click the "image" so to say and that's it.
When hitting enter in any other form it will just submit that specific form.
Scott
That's a solution, but usually not necessary.
Here's a stripped-down version of a master template that we use on a site of ours. You canh ave two forms on a page, they just can't be nested
Dan
Ah now I see what you do - one of them is a standard html form (both are not asp.net forms)
Which is why it allows you to have two form tags.
This solution will not work as both were asp.net controls however after I changed the search box to regular html form controls (then it could work of cause) it works with both forms in the same form tag.
Dan, thanks for the input.
Scott
Scott - I think you've found the ideal solution.
However if you want to read more, an eariler discussion is available at http://our.umbraco.org/forum/templating/templates-and-document-types/4101-Multiple-forms-in-templates-?sort=karma
Thanks Chris, it was rather helpful and actually found that it was excactly the same thing Dan wrote (thanks to both, and I think I will opt for that solution because it will spare me the js).
Scott
And just to confirm, it works like a charm and it is much better that way. Thank you for the eyeopener both of you.
Hmm...I have removed the server form and attached the form-tag around the two forms I have on my site...
But it does not really work very smooth...
On my page I have a subscription form and an unsubscription form - This only happens when a visitor goes to the "unsubscription" page since the subscription form is a global element on the site.
If one for some reason enters the website through the unsubscription and actually want's to subscribe for the newsletter then the e-mail entered appears on the unsubscription form field once I hit submit.
How can I solve this? I guess I'm missing something obvious but I just can't seem to get my mind right...
/Jan
you should not have a form tag around the other two forms...
What kind of forms do you have on your page?
One search and one (un)subscription?
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.