I
Itai
I have an aspx file named index.aspx which contains two ‘form'
sections, one that has the runat=server attribute (e.g From1) and one
which is a regular HTML form (e.g SignInForm).
I am trying to copy values from two INPUT controls that are located
within the Form1 section to hidden INPUT controls located in the
SignInForm and post the SignInForm form hidden controls values to a
different page (e.g login.aspx)
Problem is that after filling in values and hitting the submit button
the browser makes the post ‘click sound' but does not display
login.aspx, it continues to display the index.aspx page (the entered
values are cleared from the input controls).
BTW: Values are copied to the hidden INPUT controls in SignInForm (I
checked with alert())
Following is the code:
function SubmitLoginCredentials()
{
var homeForm, postForm
if (window.navigator.appName.toLowerCase().indexOf("netscape") > -1) {
homeForm = document.forms["Form1"];
postForm = document.forms["SignInForm"];
}
else {
homeForm = document.Form1;
postForm = document.SignInForm;
}
postForm["userid"].value = homeForm["uid"].value;
alert(postForm["userid"].value);
postForm["password"].value = homeForm["pwd"].value;
alert(postForm["password"].value);
postForm.submit();
}
<form id="SignInForm" name="SignInForm"
action="http://localhost/login.aspx" method="post" target="_self">
<input type="hidden" name="userid"> <input type="hidden"
name="password">
</form>
<form id="Form1" method="post" runat="server">
<DIV style="MARGIN-TOP: 10px; FONT-SIZE: 10pt; MARGIN-LEFT: 10px;
COLOR: white; FONT-FAMILY: Arial">Already Registered? Sign-in
here <asp:hyperlink id="Hyperlink1"
runat="server" ForeColor="White" CssClass="cssDefaultTextFontBlack">
Forgot your password? Click here</asp:hyperlink><BR>
<BR>
Username: <INPUT id="uid" style="WIDTH: 80px; HEIGHT: 16pt"
type="text" maxLength="16" size="8" name="uid">
Password: <INPUT id="pwd" style="WIDTH: 80px; HEIGHT: 16pt"
type="password" maxLength="20" size="8" name="pwd">
<INPUT id="Submit1" style="FONT-SIZE: 8pt; WIDTH: 64px; FONT-FAMILY:
Ariel; HEIGHT: 21px" onclick="SubmitLoginCredentials()" type="submit"
value="Submit" name="btnlogin"></DIV>
</form>
Thanks in advance,
-Itai
sections, one that has the runat=server attribute (e.g From1) and one
which is a regular HTML form (e.g SignInForm).
I am trying to copy values from two INPUT controls that are located
within the Form1 section to hidden INPUT controls located in the
SignInForm and post the SignInForm form hidden controls values to a
different page (e.g login.aspx)
Problem is that after filling in values and hitting the submit button
the browser makes the post ‘click sound' but does not display
login.aspx, it continues to display the index.aspx page (the entered
values are cleared from the input controls).
BTW: Values are copied to the hidden INPUT controls in SignInForm (I
checked with alert())
Following is the code:
function SubmitLoginCredentials()
{
var homeForm, postForm
if (window.navigator.appName.toLowerCase().indexOf("netscape") > -1) {
homeForm = document.forms["Form1"];
postForm = document.forms["SignInForm"];
}
else {
homeForm = document.Form1;
postForm = document.SignInForm;
}
postForm["userid"].value = homeForm["uid"].value;
alert(postForm["userid"].value);
postForm["password"].value = homeForm["pwd"].value;
alert(postForm["password"].value);
postForm.submit();
}
<form id="SignInForm" name="SignInForm"
action="http://localhost/login.aspx" method="post" target="_self">
<input type="hidden" name="userid"> <input type="hidden"
name="password">
</form>
<form id="Form1" method="post" runat="server">
<DIV style="MARGIN-TOP: 10px; FONT-SIZE: 10pt; MARGIN-LEFT: 10px;
COLOR: white; FONT-FAMILY: Arial">Already Registered? Sign-in
here <asp:hyperlink id="Hyperlink1"
runat="server" ForeColor="White" CssClass="cssDefaultTextFontBlack">
Forgot your password? Click here</asp:hyperlink><BR>
<BR>
Username: <INPUT id="uid" style="WIDTH: 80px; HEIGHT: 16pt"
type="text" maxLength="16" size="8" name="uid">
Password: <INPUT id="pwd" style="WIDTH: 80px; HEIGHT: 16pt"
type="password" maxLength="20" size="8" name="pwd">
<INPUT id="Submit1" style="FONT-SIZE: 8pt; WIDTH: 64px; FONT-FAMILY:
Ariel; HEIGHT: 21px" onclick="SubmitLoginCredentials()" type="submit"
value="Submit" name="btnlogin"></DIV>
</form>
Thanks in advance,
-Itai