I have set up a validation function in JavaScript to validate values from the HTML page:
& lt; Script & gt; Validate the function () {var tterr = document.sngo2a.ttime; // This variable area captures the value in ttime var ttserr = document.sngo2a.sngottime; // This variable field captures the value in sngottime var errortimecheck = 0; If (ttserr.value & gt; tterr.value) {errortimecheck = 1; Var Sentence 31 = "Error !! \ n \ nTake time to stop in time- and go \ n can not be more than the time of full journey"; Warning (sentence31); Warning (ttserr.value); Warning (tterr.value); } And {errortimecheck = 0; }} & Lt; / Script & gt; I get the following values from the html page:
ttime = 10 / sngottime = 7
then I expected not to see any warning message. However, I get the alert message "error ..... time in travel ........."
To confuse things even further, when I was 7 to 1 Until changed to sngottime Logic runs fine.
When values are displayed for tterr.value and ttserr.value, they start displaying correctly.
Can anyone help me find out the problem?
No comments:
Post a Comment