S.Siva
S.Siva

Reputation: 2091

Fire Button click event during onsubmit

I want to fire a click event during the onsubmit of form. In button click event I used a url which it has to redirect. I don't want to use the form's 'action" to redirect the page.

Can anyone help me in this?

Upvotes: 0

Views: 357

Answers (1)

user1342621
user1342621

Reputation: 11

Add an onsubmit event handler to your form element as follows:

form onsubmit='javascript:window.location.href="http://google.com"; return false;' 

Upvotes: 1

Related Questions