spyder
09-25-2005, 12:12 AM
i am using a form script and when you click the button it submits. i want to replace the button with a text link. please tell me if this is possible and what to replace the code with. also, is there a way that when you click into te box with the username, it selects all so that you can just type? and 1 more thing, can you set the "focus" an the submit button so that when you click enter, it submits it. thank you
<script>
//Encrypted Password script- By Rob Heslop
//Script featured on Dynamic Drive
//Visit http://www.dynamicdrive.com
function submitentry(){
password = document.password1.password2.value.toLowerCase()
username = document.password1.username2.value.toLowerCase()
passcode = 1
usercode = 1
for(i = 0; i < password.length; i++) {
passcode *= password.charCodeAt(i);
}
for(x = 0; x < username.length; x++) {
usercode *= username.charCodeAt(x);
}
//CHANGE THE NUMBERS BELOW TO REFLECT YOUR USERNAME/PASSWORD
if(usercode==134603040&&passcode==126906300)
//CHANGE THE NUMBERS ABOVE TO REFLECT YOUR USERNAME/PASSWORD
{
window.location=password+".htm"}
else{
alert("password/username combination wrong")}
}
</script>
<form name="password1">
<input type="text" name="username2" value="User Name" size="15">
<input type="password" name="password2" value="Password" size="15">
<input type="button" value="Submit" onClick="submitentry()">
</form>
<script>
//Encrypted Password script- By Rob Heslop
//Script featured on Dynamic Drive
//Visit http://www.dynamicdrive.com
function submitentry(){
password = document.password1.password2.value.toLowerCase()
username = document.password1.username2.value.toLowerCase()
passcode = 1
usercode = 1
for(i = 0; i < password.length; i++) {
passcode *= password.charCodeAt(i);
}
for(x = 0; x < username.length; x++) {
usercode *= username.charCodeAt(x);
}
//CHANGE THE NUMBERS BELOW TO REFLECT YOUR USERNAME/PASSWORD
if(usercode==134603040&&passcode==126906300)
//CHANGE THE NUMBERS ABOVE TO REFLECT YOUR USERNAME/PASSWORD
{
window.location=password+".htm"}
else{
alert("password/username combination wrong")}
}
</script>
<form name="password1">
<input type="text" name="username2" value="User Name" size="15">
<input type="password" name="password2" value="Password" size="15">
<input type="button" value="Submit" onClick="submitentry()">
</form>