Code not going to JS Validation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Gillian1985
    New Member
    • Jul 2007
    • 3

    Code not going to JS Validation

    Hi there,

    I have written a registration form with the following code which takes it to a separate JavaScript validation page:

    [CODE=php]
    <script type = "text/javascript" src = "testnewadminis tratoruser.js">

    </script>
    [/CODE]

    I know this is right, however it 's still not catching it. I've shown the code to a couple of Professors at my university and they cant work it out! Any suggestions/thoughts on the matter would be gratefully appreciated!
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    #2
    Heya, Gillian1985. Welcome to TSDN!

    What do you want your code to do? Give an example.
    What is your code doing that you don't want it to do? Give an example.
    What is your code *not* doing that it is supposed to? Give an example.

    Comment

    • Gillian1985
      New Member
      • Jul 2007
      • 3

      #3
      Hi There!

      The validation script checks each field and makes sure that the appropriate value has been entered, an error message should appear where each field has been left empty. However even if I leave all the fields empty it adds a blank record to my database. Infuriatingly i've used the exact approach in another part of my site and the JS validation works perfectly! I've checked them both thorougly and the code is the same. Even my professor has no idea whats going on with it!

      Comment

      • ak1dnar
        Recognized Expert Top Contributor
        • Jan 2007
        • 1584

        #4
        I think this is the thing you have to do. to call for a JS script in the same directory.

        src="your_jsfil e.js" // set the path here

        your_jsfile.js

        [CODE=javascript] function dosomething(){
        alert("boom")
        }[/CODE]


        Html
        [code=html]
        <html>
        <head>
        <script language="JavaS cript" type="text/javascript" src="your_jsfile.js"></script>
        </head>
        <body>
        <input name="call_js" type="button" value="try it" onclick="dosome thing()" />
        </body>
        </html>
        [/code]

        Comment

        • Gillian1985
          New Member
          • Jul 2007
          • 3

          #5
          Hi there,

          Thanks for your help, amaged to get the script working over the weekend. Will definately keeep using this site.

          Gillian

          Comment

          • ak1dnar
            Recognized Expert Top Contributor
            • Jan 2007
            • 1584

            #6
            Originally posted by Gillian1985
            Hi there,

            Thanks for your help, amaged to get the script working over the weekend. Will definately keeep using this site.

            Gillian
            glad to hear that Gillian, welcome back any time to TSDN.
            -ajaxrand

            Comment

            Working...