What is difference between html button?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mujeeb i
    New Member
    • Jul 2012
    • 7

    What is difference between html button?

    can you tell me the difference between the code:

    <input type="submit" value="click me">

    and

    <button type="submit">c lick me</button>

    //somebody tell me the difference between them with example
  • Claus Mygind
    Contributor
    • Mar 2008
    • 571

    #2
    Why don't you look at this link http://www.w3schools.com/tags/tag_button.asp

    <button> allows you to add an image to the button. I think you have have to manually assign the form submit() method to the button in order for it to actually submit the form.

    Comment

    • Murat Bastas
      New Member
      • Jul 2012
      • 25

      #3
      Tips and Notes

      Important: If you use the <button> element in an HTML form, different browsers may submit different values. Internet Explorer, prior version 9, will submit the text between the <button> and </button> tags, while other browsers will submit the content of the value attribute. Use the <input> element to create buttons in an HTML form.

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        @Murat: usually, there is no need to process the submit button’s value. And I would always prefer <button> over <input>.

        Comment

        • Murat Bastas
          New Member
          • Jul 2012
          • 25

          #5
          For example... My form is submitting with get method. And i need 2 or more send button. And i need that button's names and values to render form... If i click any button address bar is be http://example.com/formrender.php?fi...nName=sendmail or http://example.com/formrender.php?fi...me=anothertask etc... filling.

          I mean is : vary according to needs... And the decision is yours.

          Edit: Sorry for my bad english. I tried to explain something. And i used google translate. My english is not good. I hope you understand...

          Comment

          • Dormilich
            Recognized Expert Expert
            • Aug 2008
            • 8694

            #6
            that would lead to the question, why would you need 2 different submit buttons? but that is a question worth of its own thread.

            Comment

            • Murat Bastas
              New Member
              • Jul 2012
              • 25

              #7
              Why... For example, i have a data table. And each row has got a checkbox for row's id. And i have 2 buttons. Someone delete button, someone multi edit button.

              Edit : But such a form is not sending get method. Because ids an array...

              Comment

              Working...