开发者

Have only one button submit form?

开发者 https://www.devze.com 2023-02-09 01:33 出处:网络
I have inherited a project and there is a form with 3 buttons: <input type=\"submit\" id=\"ctl00_contentPlaceHolder_back\" value=\"Make Changes\" name=\"ctl00$contentPlaceHolder$back\" onClick=\"

I have inherited a project and there is a form with 3 buttons:

<input type="submit" id="ctl00_contentPlaceHolder_back" value="Make Changes" name="ctl00$contentPlaceHolder$back" onClick="history.back();">
<input type="submit" id="开发者_开发问答ctl00_contentPlaceHolder_preview" value="View Outside" name="ctl00$contentPlaceHolder$preview">
<input type="submit" id="ctl00_contentPlaceHolder_submit" value="Send Card" name="ctl00$contentPlaceHolder$submit">

How do I make it so, that only 1 button actually submits the form to another page for processing?


Change all the other ones to type="button"


Change the input type="button" instead of type="submit". These kind of look like ASP controls, so find and replace these form buttons with a plain button, unbound.


By not letting them be submit buttons. Use type="button" instead of type="submit".

0

精彩评论

暂无评论...
验证码 换一张
取 消