Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Solved] Problem with form and postdata in qtip
25th March, 08:55 (This post was last modified: 25th March 08:57 by Baukereg.)
Post: #1
[Solved] Problem with form and postdata in qtip
I have this weird problem with qtip for a quick way to enable visitors of my site to submit reactions to my blog.

I have a qtip that loads a certain url: a php file that displays a form. The submit button has an onclickevent that closes the qtip. The form uses ajax on submit to load another php file in a certain div (containing the blogreactions), using post to send its data.

It al works fine on first look. I click 'add reaction' and the qtip appears with the form. I click submit: the qtip is closed and the blogreactions refresh with my new reaction on top. But...

When I try to add another reaction, my first reaction is reposted!

Say my first reaction is "Great post", and my second is "Keep it on!", the second is ignored and the "Great post" reaction is posted a second time.

It has nothing to do with the ajax function. We have used another self-made tooltip in the past, and this problem did not occurre. It seems to be a qtip related bug.

Things I have tried to resolve this without result:
  • add a random number to the url loaded in the qtip (showform.php?rand=XXX) to make sure it doesnt load anything from cache
  • clear all data from $_POST after adding to reaction to the database
  • making sure the form is send before the qtip is closed
Find all posts by this user
Quote this message in a reply
25th March, 10:20
Post: #2
RE: Problem with form and postdata in qtip
Solved! Took me the whole morning to figure this one out! :O

After submittion, the qtip was hidden but not removed. So the form still exists but just hidden. With the 2nd qtip, another form with the same name was created, but the ajax function still used the first form.

I found this formthread a great help: http://craigsworks.com/projects/forums/t...beforeHide
Find all posts by this user
Quote this message in a reply
25th January, 18:02 (This post was last modified: 25th January 18:04 by b0gui.)
Post: #3
RE: [Solved] Problem with form and postdata in qtip
May I ask, how you were listening to the form elements inside the content: url.php.

I can't figure out how to get the form elements like $("#inputfield_name").val(). or even $("#submit").click(function() {});

Please help, thank you.

(25th March 08:55)Baukereg Wrote:  I have this weird problem with qtip for a quick way to enable visitors of my site to submit reactions to my blog.

I have a qtip that loads a certain url: a php file that displays a form. The submit button has an onclickevent that closes the qtip. The form uses ajax on submit to load another php file in a certain div (containing the blogreactions), using post to send its data.

It al works fine on first look. I click 'add reaction' and the qtip appears with the form. I click submit: the qtip is closed and the blogreactions refresh with my new reaction on top. But...

When I try to add another reaction, my first reaction is reposted!

Say my first reaction is "Great post", and my second is "Keep it on!", the second is ignored and the "Great post" reaction is posted a second time.

It has nothing to do with the ajax function. We have used another self-made tooltip in the past, and this problem did not occurre. It seems to be a qtip related bug.

Things I have tried to resolve this without result:
  • add a random number to the url loaded in the qtip (showform.php?rand=XXX) to make sure it doesnt load anything from cache
  • clear all data from $_POST after adding to reaction to the database
  • making sure the form is send before the qtip is closed

Got it Smile

$(this).parents('.qtip').qtip('hide');
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  [Solved] Ajax imagemap data problem carelmeyer 0 941 1st May 17:39
Last Post: carelmeyer
  [Solved] Problem with my map area installation timtimd 1 244 14th March 17:34
Last Post: Craig
  Hiding tooltip problem sohailanwarpk 2 403 31st January 12:13
Last Post: sohailanwarpk
  [Solved] Form submit grabbing wrong value loveccb 3 569 26th January 16:53
Last Post: ramon.alvarez
  qTip & ASP.NET UpdatePanel Postback Problem qTipNoob 4 3,033 10th January 15:01
Last Post: naupadnara
  qTip modal accept/decline form jinx8402 0 440 15th December 13:34
Last Post: jinx8402
  [Solved] Anti Virus flags up a problem OllyPercival 9 2,490 21st November 21:45
Last Post: Col
  [Solved] Problem with Fixed Position div and scrolling homerlex 7 1,467 26th October 19:35
Last Post: Craig
  post ajax from qtip2/validation form jquerynewb 4 1,346 14th July 08:19
Last Post: Craig
  [Solved] Starter problem enne87 1 631 12th July 17:29
Last Post: Craig



User(s) browsing this thread: 1 Guest(s)