Microsoft
Software
Hardware
Network
Question : How to call a javascript fn when the first javascript function succeeds only.
Hi,
I have a form with a submit button, for the same button,i have to define two actions,
on clicking the submit button, i am calling 2 javascript fns, one for validating the form and second is for calling a database function like onclick=fn1();fn2();
but. i need to save the data into database (which does by fn2()), only fn1()(validating the form ) succeeds. but for me ,right now ,its validating,and sametime saving into db. How can i do that? any idea?
Thanks in advance.
Answer : How to call a javascript fn when the first javascript function succeeds only.
Instead of:
onclick="fn1();fn2();"
do:
onclick=if(fn1()){fn2()};r
eturn false;"
OR you can just do:
onclick="fn3()";
and in fn3:
function fn3(){
if( fn1() )
fn2();
}
Random Solutions
Where is the background image located on Windows Mobile phones?
For backups using RMAN, setting NLS_LANG, NLS_DATE and parameter BACKUP_TAPE_IO_SLAVES
Write a Windows DHCP server in Python?
Oracle DB process trigger from different schema
ODBC timeout issue with access connecting to an SQL database
mpg plugin for adobe premiere 4.2 ?
Sybase Output to variable filename
Outlook 2000 inserts blank attachments automatically
"Work Offline" dialog box appears when Windows Explorer 'File' button selected
Exchange 2003 Enterprise Offline Defrag