zgkhoo Posted August 21, 2007 Share Posted August 21, 2007 <html> <body> <form action=""> <input type="button" value="Hello world!"> </form> ? </body> </html> <html> <body> <form name="input" action="html_form_action.asp" method="get"> Type your first name: <input type="text" name="FirstName" value="Mickey" size="20"> <br>Type your last name: <input type="text" name="LastName" value="Mouse" size="20"> <br> <input type="submit" value="Submit"> </form> <p> If you click the "Submit" button, you will send your input to a new page called html_form_action.asp. </p> </body> </html> may i know wat is the different? thanks. Quote Link to comment https://forums.phpfreaks.com/topic/65933-wat-different-between-submit-typebutton-and-button-types-button/ Share on other sites More sharing options...
ToonMariner Posted August 21, 2007 Share Posted August 21, 2007 submit buttons tell teh browser to take teh data entered into teh fields of teh form and pass them through the heasders to the next page. a simple button doesn't DO anything - you add some javscript to it via teh event handlers to perform some task - as js can be turned off it can prove pointless. I don't use ANY input type="button" on any of my sites - they have no place in my dictionary - links can do the same thing as buttons with the added benefit that you can use the href to make sure something gets done if js is turned off (this is predominantley my ajax requests). Quote Link to comment https://forums.phpfreaks.com/topic/65933-wat-different-between-submit-typebutton-and-button-types-button/#findComment-329743 Share on other sites More sharing options...
zgkhoo Posted August 21, 2007 Author Share Posted August 21, 2007 can i use php to put action to the "button" type's button? thanks. Quote Link to comment https://forums.phpfreaks.com/topic/65933-wat-different-between-submit-typebutton-and-button-types-button/#findComment-329811 Share on other sites More sharing options...
ToonMariner Posted August 21, 2007 Share Posted August 21, 2007 yes you can but why are you using a button instead of a submit buton? Quote Link to comment https://forums.phpfreaks.com/topic/65933-wat-different-between-submit-typebutton-and-button-types-button/#findComment-329836 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.