Jump to content
Killersites Forums

Dynamically changing onSubmit event of form


Recommended Posts



Initailly when the page loads there is no onSubmit event associated with it and I need to change the onSubmit to call a javascript function based on change's in the value.


form tag when page load's

form tag to be after change 


Any help is greatly appreciable. Thanks in advance.




Link to comment
Share on other sites

Perhaps something like this:

function set_onSubmit(ACT, ID)
   var myForm = document.getElementById(ID);
   myForm.setAttribute("onSubmit", ACT);

And you could have a button or something:


Hope it helps!


//Emil Fresk


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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