Jump to content

wat different between "submit type"button and "button type"'s button


zgkhoo

Recommended Posts

<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.

Link to comment
Share on other sites

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).

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.