/    Sign up×
Community /Pin to ProfileBookmark

Can’t figure out why my script won’t work

Good morning:

Can someone please help me… ?
This is my first JavaScript try (I know nothing about any scripting language).
Thanks to a few books, I have the scripts below and I will like the form check/do the following when the submit button is clicked:

  • 1. Automatically write the current date in the date field (DateToday).

  • 2. Check to make sure the field EmpPassNo does not have more than 6 characters, the very first character can be alpha or a zero but the last five has to be numeric.

  • 3. Check the email to make sure it is a valid email format.

  • 4. Switch name entered to last name first and capitalize.

  • 5. Format the phone number fields to (###) ###-####.

  • 6. Zip code can have only 5 digits.

  • 7. Must check either YES or NO and the fields can not be null.

  • 8. Check all other fields making sure they are not nulls.
  • The problem is that I run into the following errors:
    ●A runtime error has occurred. Line 65 Error: expected “;”
    ●The form is not checking for the conditions set above (tested it with wrong info).
    BTW, I am using FrontPage.
    The script is a word document attachment because it is long……..

    Thanks in advance for your help.

    Christiana

    [upl-file uuid=ea81f934-d2a3-4876-90c7-7d0445c595a0 size=58kB]JacaScript.doc[/upl-file]

    to post a comment
    JavaScript

    4 Comments(s)

    Copy linkTweet thisAlerts:
    @landslideNov 06.2006 — alot of these issues you can do with just a validation with your software. If you have dreamweaver or frontpage bothe of these you can set up these validation without writing any code.
    Copy linkTweet thisAlerts:
    @justinbarneskinNov 06.2006 — I would have looked at it but you left out the html that the script refers to?
    Copy linkTweet thisAlerts:
    @yellabuffNov 06.2006 — Just looking at the js you have some errors that need to be corrected.

    retun false

    should be

    return false

    function Check()

    should be

    function Check() {

    alert ("The APARTMENT NO. field is blank, please enter your apartment # or "N/A" again.");

    should be

    alert ("The APARTMENT NO. field is blank, please enter your apartment # or "N/A" again.");

    if ((theYes == "") || (theYes == null) and (theNo =="") || (theNo == null))

    should be

    if ((theYes == "") || (theYes == null) && (theNo =="") || (theNo == null))


    All code for the phone numbers needs an extra double quote

    ApplicationForm.HmPhone.value = "( + validPhoneHm[1] + ")" + validPhoneHm[2] + "-" + validPhoneHm[3]

    should be

    ApplicationForm.HmPhone.value = "(" + validPhoneHm[1] + ")" + validPhoneHm[2] + "-" + validPhoneHm[3]
    Copy linkTweet thisAlerts:
    @ademitutuauthorNov 07.2006 — I just want to thank everyone for your quick response.

    I have made all corrections and so far no run time error popping up.

    One question though, is there anyway to test this page and make sure it is doing what it is suppose to do. It opened my outlook when I hit submit but No form was attached...

    Christiana ?
    ×

    Success!

    Help @ademitutu spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 6.15,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @nearjob,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,
    )...