Hi,
I have made an afternoon's worth of attempts (with help from prior posts here) to get the submit and reset methods to fire for a login form that I have made fancy buttons for.
So far my Object doesn't support this property or method, my forehead is all black and blue and I have a hole in a wall.
Someone please point out what dopey error I'm making.
(Can't find a lot of documentation on the syntax for these things so some of it's a guess).
Thanks
//IMAGE ARRAY
but5 = new Image();
but5.src = "images/SubmitB.gif";
but5h = new Image();
but5h.src = "images/SubmitBH.gif";
but6 = new Image();
but6.src = "images/ResetB.gif";
but6h = new Image();
but6h.src = "images/ResetBH.gif";
//IMAGE SWAP FUNCTION
function changeImage(imgDocID0,imgObjName0)
{
document.images
.src = eval(imgObjName0 + ".src"
;
}
//Validate the user name and password for presence.
function ValLogin(User,Pass)
{
if (User == ""
{
alert("Please Enter A User Name"
;
LoginF.UserID.focus();
return false;
}
else if (Pass == ""
{
alert("Please Enter A Password"
;
LoginF.Password.focus();
return false;
}
else
{
document.LoginF.submit();
return true;
}
}
<form NAME="LoginF" ACTION="LoginVal.ASP" METHOD="POST">
<table CELLPADDING="0" CELLSPACING="10" BGCOLOR="#003366">
<tr>
<td COLSPAN="2" ALIGN="center" BGCOLOR="#003366">
<h2><font face="Arial, Verdana" color="#FFFFFF">Login</font></h2>
</td>
</tr>
<tr>
<td>
<p><b><font face="Arial, Verdana" color="#FFFFFF">User
Name</font><font FACE="Arial, Verdana">:</font></b></td>
<font FACE="Arial, Verdana" COLOR="#660066">
<td><input TYPE="text" SIZE="20" Name="UserID"></td></font>
</tr>
<tr>
<td><b><font face="Arial, Verdana" color="#FFFFFF">Password:</font></b></td>
<font FACE="Arial, Verdana" COLOR="#660066">
<td><input TYPE="Password" SIZE="20" Name="Password"></td></font>
</tr>
<tr>
<td><a href="#" onClick="return ValLogin(document.LoginF.UserID.value,document.LoginF.Password.value)" onmouseover="changeImage('submit','but5h')" onmouseout="changeImage('submit','but5')"><IMG src="images/SubmitB.gif" width="60" height="30"border="0" name="submit" alt="Submit Login"></a></td>
<td><a href="#" onclick="document.LoginF.reset()" onmouseover="changeImage('reset','but6h')" onmouseout="changeImage('reset','but6')"><IMG src="images/ResetB.gif" width="60" height="30"border="0" name="reset" alt="Reset Login"></a></td> </tr>
</table>
</form>
I have made an afternoon's worth of attempts (with help from prior posts here) to get the submit and reset methods to fire for a login form that I have made fancy buttons for.
So far my Object doesn't support this property or method, my forehead is all black and blue and I have a hole in a wall.
Someone please point out what dopey error I'm making.
(Can't find a lot of documentation on the syntax for these things so some of it's a guess).
Thanks
//IMAGE ARRAY
but5 = new Image();
but5.src = "images/SubmitB.gif";
but5h = new Image();
but5h.src = "images/SubmitBH.gif";
but6 = new Image();
but6.src = "images/ResetB.gif";
but6h = new Image();
but6h.src = "images/ResetBH.gif";
//IMAGE SWAP FUNCTION
function changeImage(imgDocID0,imgObjName0)
{
document.images
}
//Validate the user name and password for presence.
function ValLogin(User,Pass)
{
if (User == ""
{
alert("Please Enter A User Name"
LoginF.UserID.focus();
return false;
}
else if (Pass == ""
{
alert("Please Enter A Password"
LoginF.Password.focus();
return false;
}
else
{
document.LoginF.submit();
return true;
}
}
<form NAME="LoginF" ACTION="LoginVal.ASP" METHOD="POST">
<table CELLPADDING="0" CELLSPACING="10" BGCOLOR="#003366">
<tr>
<td COLSPAN="2" ALIGN="center" BGCOLOR="#003366">
<h2><font face="Arial, Verdana" color="#FFFFFF">Login</font></h2>
</td>
</tr>
<tr>
<td>
<p><b><font face="Arial, Verdana" color="#FFFFFF">User
Name</font><font FACE="Arial, Verdana">:</font></b></td>
<font FACE="Arial, Verdana" COLOR="#660066">
<td><input TYPE="text" SIZE="20" Name="UserID"></td></font>
</tr>
<tr>
<td><b><font face="Arial, Verdana" color="#FFFFFF">Password:</font></b></td>
<font FACE="Arial, Verdana" COLOR="#660066">
<td><input TYPE="Password" SIZE="20" Name="Password"></td></font>
</tr>
<tr>
<td><a href="#" onClick="return ValLogin(document.LoginF.UserID.value,document.LoginF.Password.value)" onmouseover="changeImage('submit','but5h')" onmouseout="changeImage('submit','but5')"><IMG src="images/SubmitB.gif" width="60" height="30"border="0" name="submit" alt="Submit Login"></a></td>
<td><a href="#" onclick="document.LoginF.reset()" onmouseover="changeImage('reset','but6h')" onmouseout="changeImage('reset','but6')"><IMG src="images/ResetB.gif" width="60" height="30"border="0" name="reset" alt="Reset Login"></a></td> </tr>
</table>
</form>