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
how configure 2 mailbox to one user
Date to String Conversion
SCRIPT for generate BCP flat file ...from MYSQL file <MIGRATION>
SQL Server ODBC Link to read/write access table
how can i implement an antivirus on godaddy hosted exchange email
Keep getting script message "Scripts are usually safe Keeps coming as"scripts are usually safe. Do you want to allow scripts to run?.
Exchange object not found
Create Copy of Database using Restore Database Option
Microsoft, Powershell, Windows Server 2008, trying to modify a local user, getttting "Exception calling "SetInfo" ...( Exception from HRESULT: 0x8007007B)"
Centos - PAE kernel how to convert to non PAE kernel