Code: Select all
andCode: Select all
tags where approriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
I have a small test page that displays a text input field and then two buttons designed to pop up a javascript calendar.
The first button is of type=image and the second one is of type=button. If I click on the image button, the calendar pops up for an instant and then the form is submitted which is not the right behavior.
when I click on the normal button, the calendar is displayed until I click a date. The data is then placed in the text box. I would like for the image button to work the same way.
I have tested this code under IE 6.0, and Firefox with the same results.
Thanks for any ideas?
I have included the code but not the javascript or image for the button. If anyone is interested in that I can post it also.
CODE:Code: Select all
<?PHP
echo "<HTML>\n";
echo "<HEAD>\n";
?>
<!-- Load Pop-up Calendar functions - - - - - - - - - - - - - - - - - -->
<SCRIPT LANGUAGE='JavaScript' SRC="/javascript/popcalendar.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="/javascript/lw_layers.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" SRC="/javascript/lw_menu.js"></SCRIPT>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<form name="opportunityEnterForm" method="POST" action="popuptest.php">
<table cellspacing="2" cellpadding="2" border="0" width="100%">
<tr valign="top" height="20">
<td align="right"> <b> Technical Close Date : </b> </td>
<td> <input type="text" name="thisTech_close_dateField" size="10" maxlength="10" value="2005/01/01">
<script language='javascript'>
if (!document.layers) {
<!-- DOESN'T WORK -->
document.write("<input type=image onclick='popUpCalendar(this, opportunityEnterForm.thisTech_close_dateField, "yyyy/mm/dd")' src='/images/buttons/cal_small.gif' align='absbottom' vspace='1'>")
<!-- THIS ONE WORKS -->
document.write("<input type=button onclick='popUpCalendar(this, opportunityEnterForm.thisTech_close_dateField, "yyyy/mm/dd")' value='...' style='font-size:11px'>")
}
</script>
</td>
</tr>
</table>
<input type="submit" name="submitEnterOpportunityForm" value="Submit">
<input type="reset" name="resetForm" value="Clear Form">
</form>Code: Select all
andCode: Select all
tags where approriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]