Click to See Complete Forum and Search --> : Hyper link to image & form submit


shanuragu
11-17-2003, 05:21 AM
HI

When I click on the image I should be able to submit the form.
This is how I am trying to implement it. But form is not getting submitted???

<script>
function ShowTicketDetails()
{
document.form.strAction.value="Book Now";
document.form.action="BookNow.asp";
document.form.method="post";
document.form.submit();
}
</script>


Is this a valid statement

<a href="javascript:ShowTicketDetails();" onclick="document.form.book_dt.value='<%=book_dt%>';document.form.book_show.value='M';"><img src="../images/available.gif" border="0" name="book"></a>

Please help.

Shara

Charles
11-17-2003, 06:12 AM
There's no reason to use icky JavaScript for that.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Example</title>

<style type="text/css">
<!--
img {border:0px}
-->
</style>

<form action="BookNow.asp" method="post">
<div>
<input type="hidden" id="strAction" value="Book Now">
<input type="hidden" id="book_dt" value="<%=book_dt%>">
<input type="hidden" id="book_show" value="M">
<input type="image" alt="Submit" src="../images/available.gif">
</div>
</form>