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. ASP.NET
  4. Regarding Javascript...

Regarding Javascript...

Scheduled Pinned Locked Moved ASP.NET
javascripthelpquestion
11 Posts 5 Posters 0 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.
  • R Offline
    R Offline
    Ron S
    wrote on last edited by
    #1

    Hello All, I have a aspx page withing which i have two radio buttons. The user has to check any one option to move further. I have written a javascript which will check whether he has checked one option or not. my problem is it is showing the alert to check one option but it is not stopping in the same page it is redirected to the next page even though the alert messaged poped up. Have i left something ??? Thanks and Regards

    Bharath.S Ron

    S S K 3 Replies Last reply
    0
    • R Ron S

      Hello All, I have a aspx page withing which i have two radio buttons. The user has to check any one option to move further. I have written a javascript which will check whether he has checked one option or not. my problem is it is showing the alert to check one option but it is not stopping in the same page it is redirected to the next page even though the alert messaged poped up. Have i left something ??? Thanks and Regards

      Bharath.S Ron

      S Offline
      S Offline
      Sathesh Sakthivel
      wrote on last edited by
      #2

      Bharath.S.Ron wrote:

      Have i left something ???

      We can't say without seeing your Code.

      SSK.

      1 Reply Last reply
      0
      • R Ron S

        Hello All, I have a aspx page withing which i have two radio buttons. The user has to check any one option to move further. I have written a javascript which will check whether he has checked one option or not. my problem is it is showing the alert to check one option but it is not stopping in the same page it is redirected to the next page even though the alert messaged poped up. Have i left something ??? Thanks and Regards

        Bharath.S Ron

        S Offline
        S Offline
        Sandeep Akhare
        wrote on last edited by
        #3

        return true for valid condtion else return false for invalid condition from javascript function

        Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

        R 1 Reply Last reply
        0
        • S Sandeep Akhare

          return true for valid condtion else return false for invalid condition from javascript function

          Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

          R Offline
          R Offline
          Ron S
          wrote on last edited by
          #4

          OnClientClick="return getCheckedRadio();" This is how i am calling the function is this correct???

          Bharath.S Ron

          S 1 Reply Last reply
          0
          • R Ron S

            OnClientClick="return getCheckedRadio();" This is how i am calling the function is this correct???

            Bharath.S Ron

            S Offline
            S Offline
            Sathesh Sakthivel
            wrote on last edited by
            #5

            Yes.

            SSK.

            R S 2 Replies Last reply
            0
            • S Sathesh Sakthivel

              Yes.

              SSK.

              R Offline
              R Offline
              Ron S
              wrote on last edited by
              #6

              the below is my javascript. function getCheckedRadio() { if(document.getElementById("SOISummitRegistrationCntrl1_RdbtnRegAdvPck").checked==true) { return true; } else if(document.getElementById("SOISummitRegistrationCntrl1_RdbtnRegOnly").checked==true) { return true; } else { alert("Please check the option"); return false; } }

              Bharath.S Ron

              S 1 Reply Last reply
              0
              • R Ron S

                the below is my javascript. function getCheckedRadio() { if(document.getElementById("SOISummitRegistrationCntrl1_RdbtnRegAdvPck").checked==true) { return true; } else if(document.getElementById("SOISummitRegistrationCntrl1_RdbtnRegOnly").checked==true) { return true; } else { alert("Please check the option"); return false; } }

                Bharath.S Ron

                S Offline
                S Offline
                Sandeep Akhare
                wrote on last edited by
                #7

                remove alert then try

                Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

                1 Reply Last reply
                0
                • S Sathesh Sakthivel

                  Yes.

                  SSK.

                  S Offline
                  S Offline
                  Sandeep Akhare
                  wrote on last edited by
                  #8

                  Hey Sathish you changed your login name Why ?

                  Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

                  N 1 Reply Last reply
                  0
                  • S Sandeep Akhare

                    Hey Sathish you changed your login name Why ?

                    Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

                    N Offline
                    N Offline
                    N a v a n e e t h
                    wrote on last edited by
                    #9

                    Sandeep Akhare wrote:

                    Hey Sathish you changed your login name Why ?

                    He was trying to hide on another name, Because his first name made lot of issues. But all CP members can identify him seeing his style of writing. That he can't change.


                    My Website | Ask smart questions

                    S 1 Reply Last reply
                    0
                    • N N a v a n e e t h

                      Sandeep Akhare wrote:

                      Hey Sathish you changed your login name Why ?

                      He was trying to hide on another name, Because his first name made lot of issues. But all CP members can identify him seeing his style of writing. That he can't change.


                      My Website | Ask smart questions

                      S Offline
                      S Offline
                      Sandeep Akhare
                      wrote on last edited by
                      #10

                      Sathish is famous member here then :):):-O:rose:

                      Thanks and Regards Sandeep If If you look at what you do not have in life, you don't have anything, If you look at what you have in life, you have everything... "

                      1 Reply Last reply
                      0
                      • R Ron S

                        Hello All, I have a aspx page withing which i have two radio buttons. The user has to check any one option to move further. I have written a javascript which will check whether he has checked one option or not. my problem is it is showing the alert to check one option but it is not stopping in the same page it is redirected to the next page even though the alert messaged poped up. Have i left something ??? Thanks and Regards

                        Bharath.S Ron

                        K Offline
                        K Offline
                        Krugger404
                        wrote on last edited by
                        #11

                        Hi, One solution, to me, would be to remove the "AutoPostback" attribute on the radio buttons and provide with a Next>> button (provide validation for this) for the user to move further. There are other means, of course, but without having a glance at your code, i just can't say. Hope this helps

                        Carpe diem, Krg

                        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