Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. JavaScript
  4. Javascript validation

Javascript validation

Scheduled Pinned Locked Moved JavaScript
javascriptdebuggingquestion
9 Posts 7 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vanikanc
    wrote on last edited by
    #1

    Hi, I have a simple validation of drop down list, making sure the user has selected either "yes" or "no". There are 3 of these dropdownlist, with values of "yes" and "no". Based on if yes is answered, user needs to fill in two text boxes. All this validation is performed using javascript. while this works fine when test, now that the site is live, having some issues, where in the user is able to submit the form without filling in the dropdownlist!! I am trying to debug this, except it is consistently working for me. Totally lost. Any ideas please???

    S G M 3 Replies Last reply
    0
    • V vanikanc

      Hi, I have a simple validation of drop down list, making sure the user has selected either "yes" or "no". There are 3 of these dropdownlist, with values of "yes" and "no". Based on if yes is answered, user needs to fill in two text boxes. All this validation is performed using javascript. while this works fine when test, now that the site is live, having some issues, where in the user is able to submit the form without filling in the dropdownlist!! I am trying to debug this, except it is consistently working for me. Totally lost. Any ideas please???

      S Offline
      S Offline
      Shahriar Iqbal Chowdhury Galib
      wrote on last edited by
      #2

      Need HTML codes as well as JS validation code to provide solution

      1 Reply Last reply
      0
      • V vanikanc

        Hi, I have a simple validation of drop down list, making sure the user has selected either "yes" or "no". There are 3 of these dropdownlist, with values of "yes" and "no". Based on if yes is answered, user needs to fill in two text boxes. All this validation is performed using javascript. while this works fine when test, now that the site is live, having some issues, where in the user is able to submit the form without filling in the dropdownlist!! I am trying to debug this, except it is consistently working for me. Totally lost. Any ideas please???

        G Offline
        G Offline
        Graham Breach
        wrote on last edited by
        #3

        What happens if the user has Javascript disabled, by using something like NoScript or browser preferences?

        M V 2 Replies Last reply
        0
        • G Graham Breach

          What happens if the user has Javascript disabled, by using something like NoScript or browser preferences?

          M Offline
          M Offline
          Manfred Rudolf Bihy
          wrote on last edited by
          #4

          Good answer! 5+ Nowadays everybody seems to take javascript availability in a browser for granted. If base functionality of ones website does rely on javascript one has to make sure to check for it since, as you have already mentioned, the user might have disabled it. Cheers!

          "With sufficient thrust, pigs fly just fine."

          Ross Callon, The Twelve Networking Truths, RFC1925

          1 Reply Last reply
          0
          • G Graham Breach

            What happens if the user has Javascript disabled, by using something like NoScript or browser preferences?

            V Offline
            V Offline
            vanikanc
            wrote on last edited by
            #5

            I have tried that option, dis-abled scripting on the browser. the web site is not funcational at all. it is just froze.

            L A 2 Replies Last reply
            0
            • V vanikanc

              I have tried that option, dis-abled scripting on the browser. the web site is not funcational at all. it is just froze.

              L Offline
              L Offline
              Luc Pattyn
              wrote on last edited by
              #6

              vanikanc wrote:

              the web site is not funcational at all. it is just froze

              That could depend on the browser being used. :)

              Luc Pattyn [My Articles] Nil Volentibus Arduum

              V 1 Reply Last reply
              0
              • L Luc Pattyn

                vanikanc wrote:

                the web site is not funcational at all. it is just froze

                That could depend on the browser being used. :)

                Luc Pattyn [My Articles] Nil Volentibus Arduum

                V Offline
                V Offline
                vanikanc
                wrote on last edited by
                #7

                Is there a way to escape the execution of javascript? Using IE7.0 and having scripting enabled? Only thing new with this is this application is set up on a bran new server, which has https enabled. Do we need something set up on server for javascript to execute properly?

                1 Reply Last reply
                0
                • V vanikanc

                  Hi, I have a simple validation of drop down list, making sure the user has selected either "yes" or "no". There are 3 of these dropdownlist, with values of "yes" and "no". Based on if yes is answered, user needs to fill in two text boxes. All this validation is performed using javascript. while this works fine when test, now that the site is live, having some issues, where in the user is able to submit the form without filling in the dropdownlist!! I am trying to debug this, except it is consistently working for me. Totally lost. Any ideas please???

                  M Offline
                  M Offline
                  Mohibur Rashid
                  wrote on last edited by
                  #8

                  The reason is you didnt use return statement. a simple example for your understanding.

                  function Validate()
                  {
                  if validation failed
                  return false;
                  else return true;
                  }

                  1 Reply Last reply
                  0
                  • V vanikanc

                    I have tried that option, dis-abled scripting on the browser. the web site is not funcational at all. it is just froze.

                    A Offline
                    A Offline
                    arya1685
                    wrote on last edited by
                    #9

                    hi, You can use both client as well as server side validation to perform your task.. First check user allowed javascript or not if yes then don't need to worry else you need to perform server side validation...........

                    Thanks & Regards Arya1685 “You are not only responsible for what you say, but also for what you do not say”

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups