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...
... 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!Code:<input type="button" onClick="ajaxpage(myCGIGeneratedCameraDocument, 'contentarea')" value="Display camera" />
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
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
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
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks