Auto submit form by javascript...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • thusinhngheo
    New Member
    • Nov 2011
    • 3

    Auto submit form by javascript...

    I want you to help me make a script:

    1. Select 1 of 3 radio button in form
    2. Write text to a text box in form
    3. Auto submit form

    Please help me, i'm from vietnam and i don't know english :)
  • johny10151981
    Top Contributor
    • Jan 2010
    • 1059

    #2
    I am not from Vietnam and I don't know English either.

    your question does not make any sense. Specially Auto submit, what do you mean by that?

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      #3
      You can find the answers to these in probably all beginner tutorials.

      1. Set the checked property:
      Code:
      btn[0].checked = true;//first button
      2. Set the value of the text box
      3. Use the form submit()
      Code:
      frm.submit();

      Comment

      • omerbutt
        Contributor
        • Nov 2006
        • 638

        #4
        i am from pakistan and i am not a terrorist :D, but i need to provide some code to elaborate my problem and more helpful for others to provide me with the solution,
        regards,
        Omer Aslam

        Comment

        • johny10151981
          Top Contributor
          • Jan 2010
          • 1059

          #5
          Buddy Omer,

          From your name I knew that you are from Pakistan,

          But the way you describe your Identity, it seems that you expect people to think about Pakistan as a country of terror.

          Anyway,

          here is a simple example of verify and submit
          Code:
          <script>
          function verify()
          {
           if(document.getElementById("cannotbenull").value=="")
           return false;
          
           return true;
          }
          </script>
          <FORM onsubmit="return verify()">
          <input id=cannotbenull>
          <submit>
          </FORM >
          in the above code, if you put the input box empty, Form wont submit.

          Comment

          • omerbutt
            Contributor
            • Nov 2006
            • 638

            #6
            its a movie by the way i reffered to :s , but you wouldnt have known any way was a dissapointment to read this message and being libral all people think that way , read above my post again , i still wrote there that i am NOT a terrorist but you still tried to notify me :D,
            anyways be happy , no more comments from my side
            regards,
            Omer Aslam

            Comment

            • thusinhngheo
              New Member
              • Nov 2011
              • 3

              #7
              Originally posted by johny10151981
              Buddy Omer,

              From your name I knew that you are from Pakistan,

              But the way you describe your Identity, it seems that you expect people to think about Pakistan as a country of terror.

              Anyway,

              here is a simple example of verify and submit
              Code:
              <script>
              function verify()
              {
               if(document.getElementById("cannotbenull").value=="")
               return false;
              
               return true;
              }
              </script>
              <FORM onsubmit="return verify()">
              <input id=cannotbenull>
              <submit>
              </FORM >
              in the above code, if you put the input box empty, Form wont submit.
              >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> >>>>>>>>>>>>>
              Thanks for your answer
              I have solved my question
              Although not understand what you say but Vietnamese very gentle, Preferred peace.

              Comment

              Working...