PHP Code:
<html>
<head>
<script type="text/javascript">
function formSubmit()
{
x=document.forms.myForm
fname=x.firstname.value.replace(/:/g,"")
lname=x.lastname.value.replace(/:/g,"")
var num1=parseInt(fname)
var num2=parseInt(lname)
if (fname<lname){
alert (lname)
false
}
else if (fname>lname){
alert (fname)
false
}
else{
alert (num1 + num2)
}
}
</script>
</head>
<body>
<form name="myForm" action="js_form_action.asp" method="get">
Firstname: <select name="firstname" size="1"> <option>00:00:00</option> <option>00:30:00</option>
<option>01:00</option> <option>01:30</option>
<option>02:00</option></select>
<br />
Lastname: <select name="lastname" size="1">
<option>00:00:00</option> <option>00:30:00</option>
<option>01:00</option> <option>01:30</option>
<option>02:00</option></select>
<br /><br />
<input type="button" onclick="formSubmit()" value="Submit">
</form>
</body>
</html>
I have this code above. You may try to run it as htm or html.
My problem is, when i open it in my browser in my office (Mozilla Firefox) with Win 2000 OS, its doing fine. But if I run it at home (IE6) with WinXP OS, all it display in the alert box is "NaN".
My question is, what is NaN, and does it have something to do with my browser and how can I fix this. Thankas very much.
__________________
$id ="waxxer";
$id = str_replace('x', 'l', $id);
echo $id;
echo " and Marj";
|