Welcome Guest, Not a member yet? Register   Sign In
form submit not working with javascript
#1

[eluser]ranjitbd[/eluser]
Code:
// i have a form but two input buttons. one is type="submit" another is type="button"
// when i click the button i set a javascript function for submit the form but its not working.....

[removed]
function bookingEditSubmit()
  {
     document.getElementById("booking_details").action = '<?php echo BASEURL?>admin/admin/confirm_booking.html';
     document.getElementById("booking_details").submit();
  }  
[removed]


<form name="booking_details" id="booking_details" action ="<?php BASEURL?>admin/admin/confirm_booking.html">

// some input field is here
// i can solved it by using <a href="">...but i need the input value of the form
// actually i have to submit this form in different controller with input data


&lt;input type="submit" name="submit" id="submit" value="Confirm"&gt; // this tag working fine
&lt;input type="button" name="submit_edit" id="submit_edit" value="Edit Confirm"&gt;  // this button showing javascript errors

&lt;/form&gt;

// so what is the solution for submit a page with javascript
#2

[eluser]danmontgomery[/eluser]
And the javascript errors are...
#3

[eluser]walrusk[/eluser]
I suspect this may help solve your problem.

EDIT: or perhaps not since you posted this ages ago... :/
#4

[eluser]Unknown[/eluser]
@SummerStudent:

Thanks for sharing that <a href="http://www.spiration.co.uk/post/1232/Submit">link</a>, saved me some hair pulling!

Only needed to rename my custom submit button, and submit() worked.




Theme © iAndrew 2016 - Forum software by © MyBB