ryonnsan Reply #1, 5 months, 1 week ago
Hi there,
I have been trying to develop a simple form using ModX that is able to submit the form without refreshing, such as the following non-modX example:
http://net.tutsplus.com/tutorials/javascript-ajax/submit-a-form-without-page-refresh-using-jquery/
demo: http://demos.net.tutsplus.com/contactform/
One obstacle that I find is that the above example requires an external file (outside modx) to process the $_POST before dealing with the SQL (INSERT INTO or SELECT FROM). The above sample uses "bin/process.php". Since this is an external file, process.php cannot get the Database Connection from ModX, hence I have to make another connection to the DB to make this work.
Is there a work around for this so that it is either:
1. The external file (process.php) is able to get the DB connection from ModX
or
2. Another method of creating Ajax Submit Form using ModX without any external file.
Please help.
I am looking forward to hearing from you.
Regards,
Ryonn
I have been trying to develop a simple form using ModX that is able to submit the form without refreshing, such as the following non-modX example:
http://net.tutsplus.com/tutorials/javascript-ajax/submit-a-form-without-page-refresh-using-jquery/
demo: http://demos.net.tutsplus.com/contactform/
One obstacle that I find is that the above example requires an external file (outside modx) to process the $_POST before dealing with the SQL (INSERT INTO or SELECT FROM). The above sample uses "bin/process.php". Since this is an external file, process.php cannot get the Database Connection from ModX, hence I have to make another connection to the DB to make this work.
Is there a work around for this so that it is either:
1. The external file (process.php) is able to get the DB connection from ModX
or
2. Another method of creating Ajax Submit Form using ModX without any external file.
Please help.
I am looking forward to hearing from you.
Regards,
Ryonn