SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Feb 2002
    0 Post(s)
    0 Thread(s)

    Validation syntax errors...


    BUG 1.

    I'm using the following code to validate a group of 4 radio buttons. The validation works but when "submit" is finally entered after all validation a pesky taskbar error displays before the user is taken to the next page. It appears to be syntax related (I think). Any ideas anyone?

    if (document.application.cuota[0].checked == false && document.application.cuota[1].checked == false && document.application.cuota[2].checked == false && document.application.cuota[3].checked == false) {
    alert (error9);
    return false;

    BUG 2

    Another related syntax error in a non-standard statement (Jeez, try saying that when your hissed!) is living here and out of my sight:

    if (lang != "en" && document.application.nif.value == "") {
    return false;

    Explanation: the site is in two languages with the same validation script shared. This particular field is *not* on the English version of the site, so the check should be "if the language is not English and the field nif is blank, show an error". Like the above it validates but gives a taskbar error. It's not related to the language issue as this works for all other standard fields.

    Can anyone point out the bugs in my lousy syntax?

    Thanks in advance and all advice appreciated.


  2. #2
    SitePoint Evangelist azizur_rahman's Avatar
    Join Date
    Nov 2001
    London, UK
    0 Post(s)
    0 Thread(s)
    can you post the HTML code of the page.. and the atual error message you get. I am not sure about complete Document Object Model (DOM) you are refering to here...

    if application is form or is that just a layer or this is a server side application? or what is that...
    Azizur Rahman
    Web Application Developer


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts