hi
i want some help with the following javascript:
<script language="javascript">
function goToURL() { window.location = "online_krat_reply_mainfr.htm"; }
function validate(){
var digits="0123456789"
var temp
if (document.testform.textfield.value==""
{
alert("No Name !"
return false
}
if (document.testform.textfield3.value==""
{
alert("No Age!"
return false
}
for (var i=0;i<document.testform.age.value.length;i++){
temp=document.testform.age.value.substring(i,i+1)
if (digits.indexOf(temp)==-1){
alert("Invalid Age !"
return false
}
}
return ??? ->problem
</script>
if first two conditions are false i want to go to another url.What should i write in the line before the last one to do that???
Note:this script was born from a mix of other two scripts: 1)defines the gotourl function
2)validates fields before submitting.
What i want to do is that when all fields are completed and submit button is pressed then go to another url.
Hope for your answer!
Thanks
i want some help with the following javascript:
<script language="javascript">
function goToURL() { window.location = "online_krat_reply_mainfr.htm"; }
function validate(){
var digits="0123456789"
var temp
if (document.testform.textfield.value==""
alert("No Name !"
return false
}
if (document.testform.textfield3.value==""
alert("No Age!"
return false
}
for (var i=0;i<document.testform.age.value.length;i++){
temp=document.testform.age.value.substring(i,i+1)
if (digits.indexOf(temp)==-1){
alert("Invalid Age !"
return false
}
}
return ??? ->problem
</script>
if first two conditions are false i want to go to another url.What should i write in the line before the last one to do that???
Note:this script was born from a mix of other two scripts: 1)defines the gotourl function
2)validates fields before submitting.
What i want to do is that when all fields are completed and submit button is pressed then go to another url.
Hope for your answer!
Thanks