HighDots Forums  

Problem: Javascript & PHP form with HTML_QuickForm

JavaScript discussion (multi-lingual) JavaScript discussion (alt.comp.lang.javascript)


Discuss Problem: Javascript & PHP form with HTML_QuickForm in the JavaScript discussion (multi-lingual) forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ronan
 
Posts: n/a

Default Problem: Javascript & PHP form with HTML_QuickForm - 07-06-2004 , 04:09 PM






Hi,

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

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.
Ronan


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',
'post','javascript:addValue();');

# 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 {
$form->display();
}

function dataProcessing($values){
#mySQL Insert request
}
#---------


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.