Lost Password?

Go Back   CodeCall Programming Forum > Web Development Forum > AJAX

AJAX Web based language that allows asynchronous loading of pages that does not interfere with normal page loading.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-06-2008, 08:58 PM
klauswunderlich klauswunderlich is offline
Newbie
 
Join Date: Apr 2008
Posts: 2
Rep Power: 0
klauswunderlich is on a distinguished road
Angry Garbled $QUERY_STRING when form submitted using AJAX

I'm trying to retrieve a value from a form with a single input: "formCameraIPAddress".
When the form is submitted using GET, I get a nice "?formCameraIPAddress=whateverIEnterHere" in the url. And $QUERY_STRING comes out as whateverIEnterHere after I run it through sed (the cgi program is a shell script). However, when the form is submitted asynchronously using an ajax method that loads pages in a content area like this...
Code:
<input type="button" onClick="ajaxpage(myCGIGeneratedCameraDocument, 'contentarea')" value="Display camera" />
... instead of getting something sensible out, it parses $QUERY_STRING as a number like 1207527656700, that always starts with the same first few digits, but then has completely random digits every time I invoke the script. It's driving me nuts that this form works synchronously, but not asynchronously, and that the query string gives a random number each time, so I'm stuck for debugging ideas!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 04-07-2008, 08:38 PM
fahlyn's Avatar   
fahlyn fahlyn is offline
Learning Programmer
 
Join Date: Nov 2007
Age: 24
Posts: 33
Rep Power: 2
fahlyn is on a distinguished road
Send a message via ICQ to fahlyn Send a message via AIM to fahlyn Send a message via MSN to fahlyn Send a message via Yahoo to fahlyn
Default Re: Garbled $QUERY_STRING when form submitted using AJAX

Can you post the body of your javascript "ajaxpage" method?

Ajax isn't actually going to "submit" a form as a normal html form would submit, you actually have to construct the URL that you want to invoke. So, my gut feeling is that your "ajaxpage" method doesn't include all of your form fields as a normal GET request from submitting a form would do.
__________________
Visit My Google Group Here: Web Development Innovation
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-07-2008, 09:24 PM
klauswunderlich klauswunderlich is offline
Newbie
 
Join Date: Apr 2008
Posts: 2
Rep Power: 0
klauswunderlich is on a distinguished road
Default Re: Garbled $QUERY_STRING when form submitted using AJAX

Yes, you're right. I've realised that the function isn't actually submitting a form at all. I'll have to construct the URL myself - not too hard, but I wish I had realised this several hours ago. :S
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-08-2008, 11:31 PM
fahlyn's Avatar   
fahlyn fahlyn is offline
Learning Programmer
 
Join Date: Nov 2007
Age: 24
Posts: 33
Rep Power: 2
fahlyn is on a distinguished road
Send a message via ICQ to fahlyn Send a message via AIM to fahlyn Send a message via MSN to fahlyn Send a message via Yahoo to fahlyn
Default Re: Garbled $QUERY_STRING when form submitted using AJAX

You may want to look into the serialize function that Prototype offers...that should allow you to dynamically build a query string based on all of your form fields. It may save you some manual work.
__________________
Visit My Google Group Here: Web Development Innovation
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
form, query_string



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ajax Form Help (validation and tips) antonypeiris AJAX 4 02-15-2008 10:01 PM
Considering Ajax, Part 1: Cut through the hype Ronin JavaScript and CSS 0 12-13-2006 02:36 PM
AJAX Evolved Jordan JavaScript and CSS 0 09-09-2006 01:12 PM
Calling a form from another form Void Managed C++ 1 07-01-2006 09:44 AM


All times are GMT -5. The time now is 11:45 PM.

Contest Stats

No contest at this time. Please check back later.

Ads