Javascript, with dynamic form Action, does not submit on (true) of confirm dialog -


I do not have a simple (no fancy frameworks) javascript, which asks a user a question when presenting a form element . If the answer is correct, then the script determines the form of a fixed URL (which contains some server-side logic inside it) and calls the invitation method of that form. Or at least, in principle, what it means! But it is not .. It just does not do anything, it appears to be presenting the form, but if this happens, then the server will have to ensure the server-side logic (which is set as the value of the action property) in the second file. That the user has been taken elsewhere.

My form here:

  & lt; Form name = 'myForm' id = 'myForm' method = 'post' on submit = 'annoyTheUser (this);' & Gt; Here is my javascript function:  
  function troubles (form) {if (confirm ("blah?")) {TheForm.action = ' Savequestion .asp '; TheForm.submit (); }}  

Your JS should appear:

 < Code> function troubles (form) {if (confirm ("blah?")} {TheForm.action = 'savequestion.asp'; Back true; } And false return; }  

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -