View Single Post
Old 08-05-2011, 07:45 AM   PM User | #21
dev07
New Coder

 
Join Date: Aug 2011
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
dev07 is an unknown quantity at this point
Quote:
Originally Posted by devnull69 View Post
CASE 2 should be the correct one ... you should continue from there and debug

1. Is the function actually being called?
2. Does it start the Ajax request
3. Does the Ajax request return with the correct result
4. Does the confirm() come up
5. Finally: Does the .submit() actually do anything?

Right now, obviously it doesn't reach step 5 ... but you can only find out through debugging

Answers to your questions.

1) Yes, the function has been called.

2) Ajax request started and getting correct result from AJAX request.

3) Confirm message is coming up.

4) Then if i press "OK", the page gets refreshed but no post submission task executes. If i press "Cancel", nothing happens.


I tried to debug and found the followings.

1) In a normal submission process [without using return false in onclick] the form gets submitted. And the url is:

http://abc.com/abc.php?InterestedUse...=&btn_submit=#


2) While using return false in onclick and after confirming "ok" , i found the following url

http://abc.com/abc.php?InterestedUse...=172&ItemId31=

where btn_submit= is missing.


I am processing the post submission query using the following code:


if(isset($_REQUEST['btn_submit']))
{
...
...
}


Now, as $_REQUEST['btn_submit'] is absent in the url, the page does not process post submission task.

I tried to modify the document.getElementById('accept_offer'+count_number).submit(); by document.getElementById('btn_submit').click(); but did not succeed. This time , the confirm message comes out whenever i am clicking on "OK".

Last edited by dev07; 08-05-2011 at 08:32 AM..
dev07 is offline   Reply With Quote