By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,871 Members | 1,645 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,871 IT Pros & Developers. It's quick & easy.

Problem: Javascript & PHP form with HTML_QuickForm

P: n/a

I have a problem with a form using the PHP PEAR HTML_QuickForm package &

I want to record the content of my form into a mySQL database then
execute a javascript function.

My problem is that javascript is executed before the mySQL insertion.
I actually need the mySQL insertion first, since my javascript function
is supposed to close the window...

Thanks for your help.
A short explanation of my code:
#--- 1 ---
#javascript function
#--- 2 ---
# javascript is called by the action field of my form

# PHP code
$form = new HTML_QuickForm('createNewsCategoryForm',

# HTML result
<form action="javascript:addValue();" method="post" ... >
#--- 3 ---
# form validation du formulaire and insertion into the mySQL database:
if ($form->validate()) {
$form->process('dataProcessing', false);
else {

function dataProcessing($values){
#mySQL Insert request

Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.