Clicking on "abc" works in Mozilla, does not work
in IE.
<form name="tom" action="">
<input type="text" value="blah"
name="blahInput">
</form>
<form name="fred" action="">
<input type="text" value="blah"
name="blahInput">
</form>
<form name="frmfindHotelMoreSearch"
id="anuj" action="http://
www.cnn.com" onsubmit="www.hilton.com"
method="post">
<a
href="javascript:;"
onclick="fnMoreSearch('frmfindHotelMoreSearch')"
class="floatright clearright">abc</a>
<input
type="hidden"
name="hdnGuestSuitsIndex"
id="hdnGuestSuitsIndex">
<input
type="hidden"
name="hdnGuestSuits"
id="hdnGuestSuits">
<input
type="hidden"
name="hdnSerchType" id="hdnSerchType"
value="N">
<input
type="hidden"
name="hdnPFSIsResPage"
id="hdnPFSIsResPage" value="Y">
</form>
<a href="#"
onclick="document.forms['fred'].submit();">Subm
it the form
"fred"</a>
<script>
function fnMoreSearch(frmFormName)
{
alert(frmFormName);
document.frmfindHotelMoreSearch.hdnSerchType.value =
"Y";
document.frmfindHotelMoreSearch.hdnGuestSuits.value =
"tester";
alert(document.frmfindHotelMoreSearch.hdnGuestSuits.value);
//document.frmfindHotelMoreSearch.submit();
submitMyForm();
}
function submitMyForm()
{
//first, call the same validation function used in the
form.onsubmit event handler
var thisresult = validateMyForm();
alert('submitMyForm: validateMyForm returned: ' +
thisresult);
//if the function returned true, submit the form
if (thisresult)
{
alert('submitMyForm: javascript will submit form');
document.getElementById('anuj').submit();
//document.frmfindHotelMoreSearch.submit();
}
}
function validateMyForm()
{
var isValid = confirm('Do you want to submit the
form?');
alert('validateMyForm: isValid = ' + isValid);
return isValid;
}
</script>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "JavaScript Forum" group.
To post to this group, send email to
JavaScript-Information googlegroups.com
To unsubscribe from this group, send email to
JavaScript-Information-unsubscribe googlegroups.com
For more options, visit this group at http://groups.google.com/group/JavaScript-Information
?hl=en
-~----------~----~----~----~------~----~------~--~---
|