websss
asked on
multiple forms on 1 page
Hi
i have a cms and i've been asked to create an email sign up form
the people have given me the code to integrate into their PHP system
the code they gave me is standard HTML which posts to a URL
1 parameter is on the querystring and the other 2 parameter are used on the "post" so they are not contained within the querystring
however, i dont think its as simple as that as asp.net doesn't allow multiple forms
whats a quick easy way to do this?
i have a cms and i've been asked to create an email sign up form
the people have given me the code to integrate into their PHP system
the code they gave me is standard HTML which posts to a URL
1 parameter is on the querystring and the other 2 parameter are used on the "post" so they are not contained within the querystring
however, i dont think its as simple as that as asp.net doesn't allow multiple forms
whats a quick easy way to do this?
<form name="form2" id="form2" method="post" action="http://clients.mysender.com/form.php?form=5" target="_blank" >
<input type="hidden" id="format" name="format" value="h" />
<input type="text" name="email" value="test@test.com" id="txtEmail" class="emailSignUp" />
<input type="submit" id="submitBtn" name="submitBtn" class="emailSignUpButton" />
</form>
ASP.NET does allow multiple forms on one page, but you cant nest them.
This link might explain how to do what you want.
http://www.c-sharpcorner.c om/UploadF ile/avi_sa njay/Multi Forms.htm0 6042006062 957AM/Mult iForms.htm .aspx
http://www.c-sharpcorner.c
Forms give you the opportunity to group fields and post only the neccesary data to the attached URL.
Example:
Example:
<html>
<body>
<p>Sign in</p>
<form id="form1" action="login.asp" method="post">
<input type="text" name="user" />
<input type="password" name="password" />
<input type="submit"/>
</form>
<p> or sign up for our newsletter</p>
<form id="form2" action="newsletter.asp" method="post">
<input type="text" name="email" />
<input type="submit"/>
</form>
</body>
</html>
Ah, forgot about the "one form with runat=server per page" rule...
You can only have several forms on your page, but only one form with "runat=server". Because your second form only uses static data, this should be no problem.
You can only have several forms on your page, but only one form with "runat=server". Because your second form only uses static data, this should be no problem.
ASKER
can i put my non-runatserver form inside the standard runatserver asp.net form?
ASKER
ok slight issue
as its in a cms the whole server form needs to be throughout the page so i cant have multiple forms
what other options do i have
as its in a cms the whole server form needs to be throughout the page so i cant have multiple forms
what other options do i have
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
And a 3rd option. This may not work if the server only accpets the "post" action:
<input type="text" name="email" value="test@test.com" id="txtEmail" />
<input type="button" value="Go" id="submitBtn" name="submitBtn" onClick="window.open('http://clients.mysender.com/form.php?form=5&format=h&email=' + document.getElementById('txtEmail').value );" />