0

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.

2 Answers 2

1

Something like this:

$('delete selector').bind('click', function() { $('#myForm').submit() });
Sign up to request clarification or add additional context in comments.

Comments

0

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>

1 Comment

@DH__ then something is wrong with your HTML, show the form code in your question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.