hello
i am facing a practical prob.
i am making the validation in the javascript butt it is not functioning properly,i like to use the nested function for validation with ext javas file>
i am sending the code:
JAVA SCRIPT CODE:
function validation(objEvent)
{
//calling function in the function
fncNest(objEvent)
if(objEvent.txtsec.value=="")
{
alert("Enter Text")
return false
}
}
function fncNest(pass)
{
if(pass.txtfst.value=="")
{
alert("Enter Value")
pass.txtfst.focus()
return false
}
if(pass.txtfst.value=="hello")
{
alert("Entered hello")
pass.txtfst.focus()
return false
}
else
{
return true
}
}
AND THE HTML CODE IS:
<html>
<head>
<script src=javascript.js></script>
</head>
<body>
<form name="frmtest" >
<input type=text name=txtfst>
<input type=text name=txtsec>
<input type=image onclick="return validation(frmtest)">
</form>
</body>
</html>
IT IS NOT FUNCTIONING PROPERLY I MEAN I AM FACING PROB IN THE RETURNING:
PLZ. EXECUTE THE CODE this is showing the two alert box simultaneously while i donot want this i want that it should prompt according to the condition:
Plz help me:
nested function ??????????????
Moderator: General Moderators
- softsolvers
- Forum Commoner
- Posts: 75
- Joined: Fri Feb 13, 2004 4:26 am
- Location: India