Hi,
I have a two forms in a page called lower and upper forms.
I Need to submit the upper form always based on lower form value.If the lower form text box value is "abc" (Default value)then I should not submit the upper form and return false.
But when I try to submit the form with the default value("abc"), then i get a blank screen with false printed.
Here is the sample code
<html>
<head>
<script>
function callnow()
{
if (document.frmlower.txtlower.value =="abc")
{
return false;
}
else
{
document.frmupper.method="post";
//alert(document.frmupper.action);
document.frmupper.action="testres.asp";
document.frmupper.submit();
}
//document.frmlower.submit();
//return true;
}
</script>
</head>
<form name="frmupper" id="frmupper" >
Upper Form <input type="hidden" name="h1" value=http://www.webdeveloper.com/forum/archive/index.php/"inital"> <input type="text" name="txtupper" value="123">
<!--<input type="button" name="add" value="add" onclick="test();">-->
<br />
<br>
</form>
<form name="frmlower" ID="frmlower">
<!--<input type="image" name="submit" value="submit" ID="Image1" onclick="callnow();"/>-->
LOWER FORM<input type="text" name="txtlower" value="abc" ID="Text1">
<a href="javascript:callnow();"><img src="" alt="image"></a>
</form>
</html>
Thanks in advance.
I have a two forms in a page called lower and upper forms.
I Need to submit the upper form always based on lower form value.If the lower form text box value is "abc" (Default value)then I should not submit the upper form and return false.
But when I try to submit the form with the default value("abc"), then i get a blank screen with false printed.
Here is the sample code
<html>
<head>
<script>
function callnow()
{
if (document.frmlower.txtlower.value =="abc")
{
return false;
}
else
{
document.frmupper.method="post";
//alert(document.frmupper.action);
document.frmupper.action="testres.asp";
document.frmupper.submit();
}
//document.frmlower.submit();
//return true;
}
</script>
</head>
<form name="frmupper" id="frmupper" >
Upper Form <input type="hidden" name="h1" value=http://www.webdeveloper.com/forum/archive/index.php/"inital"> <input type="text" name="txtupper" value="123">
<!--<input type="button" name="add" value="add" onclick="test();">-->
<br />
<br>
</form>
<form name="frmlower" ID="frmlower">
<!--<input type="image" name="submit" value="submit" ID="Image1" onclick="callnow();"/>-->
LOWER FORM<input type="text" name="txtlower" value="abc" ID="Text1">
<a href="javascript:callnow();"><img src="" alt="image"></a>
</form>
</html>
Thanks in advance.