JavaScript Forum JS Made Easy: Free JavaScripts Tutorials Example Code
About This Product
The Business Internet
Find it on This page:
| Over 5000 Free Fonts | Tutorials | Javascript Forum | Other Javascript Resources | Cheat Sheet

Jsmadeeasy Forums Home   Search   Login   Register   Member List  
JS Made Easy  > JavaScript programming  > Re:  
Display using:  
Previous Thread :: Next Thread 
 Author Thread: Need help with javascript.
prasu_kv is not online. Last active: 7/28/2004 3:52:08 PM prasu_kv
Joined: 28 Jul 2004
Total Posts: 1
Need help with javascript.
Posted: 26 Feb 2002 08:44 AM
Hi guys,

I am new to javascript and would like help reg. a prob. I have a two buttons on a page and have 2 javascript functions. One does validation of the fields on the page and the other does the page navigation. Now my problem is how to call one function from the other. I mean when I click the button, it should first call the validation function and if that returns true then call the other function. Pl. help.

Admin is not online. Last active: 12/1/2005 12:27:12 PM Admin
Top 25 Poster
Forum Moderator
Joined: 28 Jul 2004
Total Posts: 15
Posted: 26 Feb 2002 10:22 AM
try this:

<form name="frm">
<input type="button" value="First Button" onclick="MyFirstFunc()">

function MyFirstFunc()
tempvar = false
... do validation
if validation is good then tempvar = true
if tempvar = true then
else return false

I think this should work

Previous Thread :: Next Thread 
Goto to page:  Prev Next  > JS Made Easy  > JavaScript programming  > Re: