简体   繁体   中英

Submit form with second submit button using jquery

I am having two submit button on a form named 'Save' and 'Delete'. Now I want to explicitly do submit with Delete button. How can I do it? I have tried following:

$('#myForm').submit();

and

$('#myForm').bind('Delete').submit(); // Delete is value of delete submit button.

but it don't work for delete functionality. Pls help.

像这样:

$('delete selector').bind('click', function() { $('#myForm').submit() });

Do you have to use jQuery? Can you not make the delete button a submit type?

<input type="submit" name="delete" value="delete"/>

Or:

<button type="submit" name="delete">Delete</button>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM