...

View Full Version : OnClick and XHTML issue



Sman5109
07-17-2007, 11:05 PM
Hello, Ummm i know almost nothing about JS because i dont use it, and thus never learned it. So, im recoding this site to be valid xhtml and i need to remove "name=\"loginform\"" from the form but "onclick=\"document.loginform.submit();\"" uses it to work. How do I fix the onclick to work without the name attribute?


<form name=\"loginform\" id=\"login\" action=\"clients/dologin.php?goto=clientarea\" method=\"post\">";##edit action="" to match your whmcs dir
echo "
<p><input name=\"username\" type=\"text\" class=\"logintext\" value=\"Email Address\" onfocus=\"if (this.value=='Email Address')this.value='';\" onblur=\"if (this.value=='')this.value='Email Address'\" />
<input name=\"password\" type=\"password\" class=\"logintext\" value=\"Password\" onfocus=\"if (this.value=='Password')this.value='';\" onblur=\"if (this.value=='')this.value='Password'\" />
<input type=\"submit\" value=\"Login\" style=\"display:none;\" />
<img class=\"submit\" src=\"images/loginbuttonbg.jpg\" alt=\"Login\" width=\"36\" height=\"28\" id=\"Image1\" onclick=\"document.loginform.submit();\" onmouseover=\"MM_swapImage('Image1','','images/loginhover.jpg',1)\" onmouseout=\"MM_swapImgRestore()\" /></p>
</form>

Thank You.

felgall
07-17-2007, 11:31 PM
document.getElementById('login').submit();

Sman5109
07-17-2007, 11:35 PM
Great! Thank you very much!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum