0 Replies Latest reply on Dec 30, 2011 3:23 PM by waterunderthebridge

    Displaying query results on same page as form

    waterunderthebridge Level 1

      I'm working on improving some event registration forms. What I inherited is a form page, where a user selects his/her name from a CFSELECT, which queries an employee

      Oracle DB, and then chooses an event and a date. These form variables are sent to an action page, containing various types of logic(Did the user select a name? Did the user

      choose an event? A date? Did the user already register? Is that event already closed?). And that action page sends the user back to the form to make other selections.


      Using CFLAYOUT and CFLAYOUTAREA, CF solves this problem nicely. It looks beautiful, and the page refreshes perfectly.


      The problem is that I need to move these templates to another server, which needs a hotfix, and that could take some time.


      So what I'd like to do in the meantime is to get this form page working by using AJAX and JQuery explicitly.


      I've done this sort of thing before, using the 'GET' method, but in this case, it would involve simpler development if I could use 'POST'

      which is the method of the form I'm working with. If there is a way to modify the 'GET' method to send three querystring variables, I'd

      be willing to try that. But it seems simpler to use POST.


      In all my Googling, I seem to see that if I send these form variables to a database as an INSERT and also expect to get results back

      to an AJAX area(like a DIV), then I need to serialize via JSON. I've seen that function in the Adobe help, but I really don't understand

      what it does or how I would use it.


      So I think my situation is this: I could do an AJAX callback(I hope that's the right term) using one querystring variable and the 'GET'

      method, but how can I do the same thing using three form variables and the 'POST' method(or the 'GET' method, if I can understand

      how to do that)?


      In all the Google hits I read, everyone says how easy JQuery makes one's life, but in this case, I really don't see how it's making my

      life any easier. I've spent days searching. CFLAYOUT is great, but if you have a server that doesn't support that, then what do you do?