469,648 Members | 1,540 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,648 developers. It's quick & easy.

Question about reloading page

Hi,

I am new to javascript, but have been programming in C for awhile. I am currently trying to get a page to reload after a password has gone through, in order to trigger another event, however, I cannot figure out the code. This code was generated by a program my company is using for survey tracking. I kind of got thrown into this (the he's good with computers syndrome) and I have NO clue what to do... please help if possible. Here is the source from the page



<HTML>
<HEAD>
<title></title>
<META content="" name=Description>
<LINK rel="stylesheet" href='/LWC_00173/css/173_2.css'>

</head>
<script language="JavaScript" src="js/basic.js"></script>
<script language="JavaScript">

function setFocus()
{
document.invitForm.invitLogin.focus();
/* ex
form1.zipcode.focus();
*/
}

function validationInvit(invForm, required)
{
//alert('validationInvit');
var appName = getBrowserName();
var fields1 = new Array (3)

fields1[0] = invForm.invitLogin.value
fields1[1] = invForm.invitLogin.value.length

var fieldName = new Array (3)

fieldName[0] = 'Email';

caution = 'Please enter';
var err = 0;
var alertColumn ='Please enter';

var Error1 = 'Please complete all fields';
var Error2 = 'Email address is invalid';
var Error3 = 'Invalid Password';

if ((fields1[1] == 0) && required) {
err = 1;
alertColumn += " "+fieldName[0]+" ";
} else {
if (!validateEmail(fields1[0], required)) {
err = 2;
}
// if(fields1[0].indexOf("@") == -1){
// }
}
//alert ('loginType=['+invForm.loginType.value+']');
if(appName == 'MSIE')
{
if(err == 1)
{
msg.innerText = Error1;


return false;
}
else if(err ==2)
{
msg.innerText = Error2;
return false;
}
else
{
invForm.submit();
return true;
}
}
else
{

if(err == 1)
{
alert(convertAlert(alertColumn, document.tmpEditbox));
return false;
}
else if(err == 2)
{
//alert("Error : Email address is invalid (must have '@' in the email address).")
alert(convertAlert(Error2, document.tmpEditbox));
return false;
}
else
{
invForm.submit();
return true;
}
}
}




</script>
<BODY CLASS=body-background LEFTMARGIN=0 MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0 >











<IFRAME NAME="tmpEditbox" style="visibility: hidden;" height="1"></IFRAME>
<label id = msg></label>




<TABLE BGCOLOR=#ffffff border=0 cellPadding=0 cellSpacing=0 width=760 align="center">
<TR>
<TD><IMG ALT="Company Name" BORDER=0 align="absmiddle" SRC='/LWC_00173/images/2_avalon_banner.JPG'></TD>
</TR>
</TABLE>



<TABLE border=0 CELLPADDING=0 CELLSPACING=0 WIDTH=760 align="center">
<TR>
<TD>
<CENTER>

<TABLE border=0 CELLPADDING=0 CELLSPACING=0 WIDTH=660>
<TR>
<TD ALIGN=LEFT><FONT CLASS=headline>&nbsp;</FONT></TD>
<TD rowSpan=2 valign=top>

<BR><BR>&nbsp;<IMG ALT="Image" border=0 src='/LWC_00173/images/spacer.gif'>

</TD>
</TR>
<TR>
<TD HEIGHT=280 VALIGN=top><br>
<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0>
<TR>
<TD><FONT CLASS=body-font><DIV style="BACKGROUND-COLOR: transparent"><FONT face="Arial, Helvetica, sans-serif" size=2><P><FONT face="Arial, Helvetica, sans-serif" size=2>Welcome,</FONT></P><P><FONT face="Arial, Helvetica, sans-serif" size=2><BR>Please enter your password!</FONT></P><P><FONT size=2></FONT>&nbsp;</P><P><FONT face="Arial, Helvetica, sans-serif"><FONT size=2>Thank you,</FONT></FONT></P><P><FONT face="Arial, Helvetica, sans-serif"><FONT size=2>Avalon Carpet Management</FONT></FONT<CENTER> <CENTER></CENTER><CENTER>&nbsp; </FONT></DIV></CENTER></FONT></font></TD>

</TR>
<TR>
<TD>&nbsp;</TD>
</TR>
</TABLE>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>
<TR>

<TD VALIGN=top width="140">
<form name="invitForm" method="post" action="frontLogin.jsp" ><input type="hidden" name="loginType" value="prospect">

<BR>



<FONT CLASS=body-bold>Password</FONT><BR>
<FONT CLASS=body-font>
<INPUT name=invitPassword type=password value="">

</FONT><BR>
<CENTER>




<INPUT type=button value="Enter" onclick='javascript: document.invitForm.submit();return true;' >


</CENTER></form>
</TD>
<TD VALIGN=top width="20">&nbsp;</TD>


</TR>
<!--<TR>
<TD COLSPAN=3>&nbsp;</TD>
</TR>
<TR>
<TD CLASS=error-msg ALIGN=center COLSPAN=3>
<br>
<label id = msg></label><br>
</TD>
</TR>-->
</TABLE>
<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0>
<TR>
<TD><FONT CLASS=body-font></font></TD>
</TR>
<TR>
<TD>&nbsp;</TD>
</TR>

</TABLE>
</TD>
</TR>
</TABLE>
</center>
</TD>
</TR>
</TABLE>



<TABLE border=0 CELLPADDING=0 CELLSPACING=0 WIDTH=760 align="center">
<TR>
<TD ALIGN=center valign="top" ><FONT CLASS=copyright></FONT></TD>
</TR>
<TR><TD>&nbsp;</TD></TR>
<TR>
<TD ALIGN="center"><FONT CLASS=copyright><A style="color:#666666;" HREF="http://www.mindfireinc.com" target="new" >Powered by MindFire
</A></FONT></TD>
</TR>

</TABLE>
</BODY>
</HTML>

Any ideas on how to get the page to reload while saving the password? Thanks!
Nov 27 '06 #1
2 1259
I was thinking i could do a redirect somewhere in there, but how would I tie that in to the onclick for the enter button? would it be something like action=document.location="http://blahblah.blahblah.com";? Anyone?
Nov 27 '06 #2
AricC
1,892 Expert 1GB
Why don't you redirect the user to the same page on the submit? This may steer you in the right direction.
Nov 27 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by Andy | last post: by
2 posts views Thread by Snolly | last post: by
3 posts views Thread by Richard | last post: by
6 posts views Thread by Jorge Luzarraga Castro | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.