O
Olly
Hello Everyone!
Could someone please have a look at my JS Form I posted
below....Something wrong there, but I don't understand what's exactly.
Many thanks.
Olly
===============================
<script language="JavaScript">
function checkChars(field, fieldName) {
var okchars =
"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@.-"
var ok = "yes";
var temp;
for (var i = 0; i < field.value.length; i++) {
temp = "" + field.value.substring(i, i+1);
if (okchars.indexOf(temp) == "-1") ok = "no";
}
if (ok == "no") {
alert("The " + fieldName + " field must contain only alphabetic or
numeric characters, please check for invalid characters.");
field.focus();
field.select();
}
}
function valForm2(theForm){
var ps = document.Form2.single_pw.value;
var theAction = "http://vubiz.com/default.asp?vcust=CCHS2544&vId=" +
ps +
"&vSource=http://ccohs.ca/products/coursesNew/loginnewforall.html";
document.Form2.target = "_blank";
history.go(0);
if (ps == "") {
alert("Please enter your password.");
document.Form2.single_pw.focus();
}
else {
document.Form2.action = theAction;
document.Form2.submit();
}
}
function valForm3(theForm){
var mps = document.Form3.multi_pw.value;
var custID = document.Form3.Cust.value;
var theAction = "http://vubiz.com/v5/default.asp?vCust=" + mps +
"&vId=" + custID + "&vLang=EN" +
"&vSource=http://ccohs.ca/products/coursesNew/loginnewforall.html";
document.Form3.target = "_blank";
history.go(0);
if (mps == "") {
alert("Please enter your password.");
document.Form3.multi_pw.focus();
}
else if (Cust == "") {
alert("Please enter your Customer ID.");
}
else {
document.Form3.action = theAction;
document.Form3.submit();
}
}
</script>
=================
<div align="center">
<table border="0" cellpadding="10" cellspacing="0" width="60%">
<TR>
<TD ALIGN="left" class="bodytext" colspan="3"><strong>Single User
Login :</strong></TD>
</TR>
<TR><form name="Form2" action="javascript:valForm2('Form2');"
method="post">
<TD ALIGN="center" class="bodytext">Password:</TD>
<TD ALIGN="left"><input type="password" name="single_pw" size="10"
onBlur="checkChars(this, 'Password');">
</TD>
<TD ALIGN="left"><input type="image" src="/images/login_on_grey.gif"
width="75" height="17" border="0" value="Link to Login page"
alt="Login"></TD>
</TR>
<TR>
<TD> </TD>
</TR>
</form>
<form name="Form3" action="javascript:valForm3('Form3');"
method="post">
<TR>
<TD ALIGN="left" class="bodytext" colspan="3"><strong>Multi User
License Login :</strong></TD>
</TR>
<TR>
<TD ALIGN="center" class="bodytext">Customer ID:</TD>
<TD ALIGN="left"><input type="text" name="Cust" size="10">
</TD>
<TD ALIGN="left"> </TD>
</TR>
<TR>
<TD ALIGN="center" class="bodytext">Password:</TD>
<TD ALIGN="left"><input type="password" name="multi_pw" size="10"
onBlur="checkChars(this, 'Password');">
</TD>
<TD ALIGN="left"><input type="image" src="/images/login_on_grey.gif"
width="75" height="17" border="0" value="Link to Login page"
alt="Login"></TD>
</TR>
<TR>
<TD> </TD>
</TR>
</form>
</table>
</div>
Could someone please have a look at my JS Form I posted
below....Something wrong there, but I don't understand what's exactly.
Many thanks.
Olly
===============================
<script language="JavaScript">
function checkChars(field, fieldName) {
var okchars =
"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@.-"
var ok = "yes";
var temp;
for (var i = 0; i < field.value.length; i++) {
temp = "" + field.value.substring(i, i+1);
if (okchars.indexOf(temp) == "-1") ok = "no";
}
if (ok == "no") {
alert("The " + fieldName + " field must contain only alphabetic or
numeric characters, please check for invalid characters.");
field.focus();
field.select();
}
}
function valForm2(theForm){
var ps = document.Form2.single_pw.value;
var theAction = "http://vubiz.com/default.asp?vcust=CCHS2544&vId=" +
ps +
"&vSource=http://ccohs.ca/products/coursesNew/loginnewforall.html";
document.Form2.target = "_blank";
history.go(0);
if (ps == "") {
alert("Please enter your password.");
document.Form2.single_pw.focus();
}
else {
document.Form2.action = theAction;
document.Form2.submit();
}
}
function valForm3(theForm){
var mps = document.Form3.multi_pw.value;
var custID = document.Form3.Cust.value;
var theAction = "http://vubiz.com/v5/default.asp?vCust=" + mps +
"&vId=" + custID + "&vLang=EN" +
"&vSource=http://ccohs.ca/products/coursesNew/loginnewforall.html";
document.Form3.target = "_blank";
history.go(0);
if (mps == "") {
alert("Please enter your password.");
document.Form3.multi_pw.focus();
}
else if (Cust == "") {
alert("Please enter your Customer ID.");
}
else {
document.Form3.action = theAction;
document.Form3.submit();
}
}
</script>
=================
<div align="center">
<table border="0" cellpadding="10" cellspacing="0" width="60%">
<TR>
<TD ALIGN="left" class="bodytext" colspan="3"><strong>Single User
Login :</strong></TD>
</TR>
<TR><form name="Form2" action="javascript:valForm2('Form2');"
method="post">
<TD ALIGN="center" class="bodytext">Password:</TD>
<TD ALIGN="left"><input type="password" name="single_pw" size="10"
onBlur="checkChars(this, 'Password');">
</TD>
<TD ALIGN="left"><input type="image" src="/images/login_on_grey.gif"
width="75" height="17" border="0" value="Link to Login page"
alt="Login"></TD>
</TR>
<TR>
<TD> </TD>
</TR>
</form>
<form name="Form3" action="javascript:valForm3('Form3');"
method="post">
<TR>
<TD ALIGN="left" class="bodytext" colspan="3"><strong>Multi User
License Login :</strong></TD>
</TR>
<TR>
<TD ALIGN="center" class="bodytext">Customer ID:</TD>
<TD ALIGN="left"><input type="text" name="Cust" size="10">
</TD>
<TD ALIGN="left"> </TD>
</TR>
<TR>
<TD ALIGN="center" class="bodytext">Password:</TD>
<TD ALIGN="left"><input type="password" name="multi_pw" size="10"
onBlur="checkChars(this, 'Password');">
</TD>
<TD ALIGN="left"><input type="image" src="/images/login_on_grey.gif"
width="75" height="17" border="0" value="Link to Login page"
alt="Login"></TD>
</TR>
<TR>
<TD> </TD>
</TR>
</form>
</table>
</div>