Still doesn't work !!!! Help, please! 
Author Message
 Still doesn't work !!!! Help, please!

As I wrote earlier, I'm writing a script on web page and all the time I'm
getting an error while testing. I changed everything to upper case, still
don't work.
I'm in despair... Maybe something with my browser, because I tried to write
even example from the book - with no results...Help!!!!!!
here the code
<SCRIPT LANGUAGE="JAVASCRIPT">
FUNCTION CHECK (FORM) {
ZIP=FORM.ZIP.VALUE;
IF (ZIP=="") {
 ALERT ("Please, enter your zip code !");
RETURN;
Quote:
}

ELSE (ZIP.LENGTH !==5) {
 ALERT ("Your zip code must be five digits !");
Quote:
}
RETURN ();
}

</SCRIPT>
</HEAD>
<BODY>
<FORM>
<INPUT TYPE=TEXT NAME="ZIP" SIZE=5>
<INPUT TYPE=BUTTON VALUE="CHECK IT" ONCLICK="CHECK(THIS.FORM)">
</FORM>
</BODY>
</HTML>

--
Aleksandr Khvatov



Sat, 03 May 2003 03:00:00 GMT  
 Still doesn't work !!!! Help, please!
try:

<script>
function check(form) {
    var zip = form.zip.value
    if (zip == '') {
        alert('Please enter your zip code.');
        return false;
    } else if ( zip.length != 5) {
        alert('Your zip code must be five digits.');
        return false;
    }
    return true;

Quote:
}

given:
<form onsubmit="return check(this)">
<input name=zip value="">
<input type=submit value="Check Zip">
</form

OR

<form>
<input name=zip>
<input type=button value="Check Zip" onclick="check(this.form)">
</form>

-Scott Wessels


Quote:
> As I wrote earlier, I'm writing a script on web page and all the time I'm
> getting an error while testing. I changed everything to upper case, still
> don't work.
> I'm in despair... Maybe something with my browser, because I tried to
write
> even example from the book - with no results...Help!!!!!!
> here the code
> <SCRIPT LANGUAGE="JAVASCRIPT">
> FUNCTION CHECK (FORM) {
> ZIP=FORM.ZIP.VALUE;
> IF (ZIP=="") {
>  ALERT ("Please, enter your zip code !");
> RETURN;
> }
> ELSE (ZIP.LENGTH !==5) {
>  ALERT ("Your zip code must be five digits !");
> }
> RETURN ();
> }
> </SCRIPT>
> </HEAD>
> <BODY>
> <FORM>
> <INPUT TYPE=TEXT NAME="ZIP" SIZE=5>
> <INPUT TYPE=BUTTON VALUE="CHECK IT" ONCLICK="CHECK(THIS.FORM)">
> </FORM>
> </BODY>
> </HTML>

> --
> Aleksandr Khvatov



Sat, 03 May 2003 03:00:00 GMT  
 Still doesn't work !!!! Help, please!
This will do ! Mind case sensitivity !!!
Please, use Reply Group instead of  New Message in order to minimize the
number of new messages !
Joost Devos

<HTML>
<HEAD>
<SCRIPT LANGUAGE="JAVASCRIPT">
function CHECK (FORM) {
var ZIP=MyForm.ZIP.value;
if (ZIP=="") {
 alert ("Please, enter your zip code !");
return;

Quote:
}

if (ZIP.length !==5) {
 alert ("Your zip code must be five digits !");
return;

Quote:
}
}

</SCRIPT>
</HEAD>
<BODY>
<FORM id=MyForm>
<INPUT TYPE=TEXT NAME="ZIP" SIZE=5>
<INPUT TYPE=BUTTON VALUE="CHECK IT" ONCLICK="CHECK(this.FORM)">
</FORM>
</BODY>
</HTML>


Quote:
> As I wrote earlier, I'm writing a script on web page and all the time I'm
> getting an error while testing. I changed everything to upper case, still
> don't work.
> I'm in despair... Maybe something with my browser, because I tried to
write
> even example from the book - with no results...Help!!!!!!
> here the code
> <SCRIPT LANGUAGE="JAVASCRIPT">
> FUNCTION CHECK (FORM) {
> ZIP=FORM.ZIP.VALUE;
> IF (ZIP=="") {
>  ALERT ("Please, enter your zip code !");
> RETURN;
> }
> ELSE (ZIP.LENGTH !==5) {
>  ALERT ("Your zip code must be five digits !");
> }
> RETURN ();
> }
> </SCRIPT>
> </HEAD>
> <BODY>
> <FORM>
> <INPUT TYPE=TEXT NAME="ZIP" SIZE=5>
> <INPUT TYPE=BUTTON VALUE="CHECK IT" ONCLICK="CHECK(THIS.FORM)">
> </FORM>
> </BODY>
> </HTML>

> --
> Aleksandr Khvatov



Sat, 03 May 2003 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Please Help! wondow.status doesn't work

2. Can someone tell me why this doesn't work please

3. Object Doesn't Support Property or Method error Please help

4. Help needed !! Why doesn't this work

5. 'history' command doesn't work

6. Why LoadPicture() works on local pathes and doesn't work on the URLS

7. works / doesn't work, why?

8. Dosn't Work Well Please help Me...

9. 2 apostrophe fix doesn't work for just 's

10. GetObject() in VBScript on web page doesn't work

11. Reset button doesn't work

12. Response.Buffer=false - still doesn't work

 

 
Powered by phpBB® Forum Software