Using the callback function for .load()
Hello everyone, I'm a jQuery novice and I think I've gotten myself in over my head here. Would appreciate some help if possible. Thanks.
I have a #Calculate button with a click function attached which, when clicked, iterates through a form and sends the users input values, via $_GET, to a php script called 'prepsession.php'. Here the inputs are validated and sanitized, a session is started and some session variables are created using the form input values. If there are any errors I want error messages displayed beside the form. Everything works fine up to this point.
If this script runs ok without giving any errors I would like to fire another php script called 'printsummary.php' which accesses the previously created session variables and inserts them into a div #PanelContent. The reason I am using separate php scripts for this is that I would like to be able to print my data in various different ways so I have numerous php print scripts accessing the session variables.
What mistake am I making with the load function here?
- /* Event handler for the calculate button */
- $('#Calculate').click(function(){
- var params = $('#inputform').serialize();
- var url = 'prepsession.php'+ '?' + params;
- $('#ErrorArea').load(url, function(){
- $('PanelContent').load('printsummary.php')
- });
- });