Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 996
  • Last Modified:

Formatting onclick <form> action

1.  I have a simple PHP page that makes use of a 3rd party popup date picker (http://www.triconsole.com/php/calendar_datepicker.php).  My draft page is here:

2.  Currently, I am using a button to submit the date, once picked, then using "$theDate = isset($_REQUEST["CalDate"]) ? $_REQUEST["CalDate"] : "";" to read the value in the picker.

3.  The above works fine, but has a formatting problem -- the table is redrawn badly while the popup calendar is visible.

I'd like to either resolve the formatting problem (see the above link to view it for yourself), or, preferably, to add an onclick event so that the user can POST the form by simply clicking on a date in the popup date picker.  This is, without having to click the "Go" button to POST.

Any comments and help are most welcome!
    <script language="javascript" src="calendar.js"></script>
    <form action="interpretSQL.php?callingPage=runDateSQL" method="post">
	// Process search criteria based on calling page
	switch ($_SESSION["callingPage"]) {
          case "runDateSQL":
		      // If user has requested a single date, set search criteria to the given date
			  $_SESSION["searchCriteria"] = date("Y-m-d", strtotime($StartDate));
			  	<table border="0" cellpadding="0" cellspacing="0">
			    <script type="text/javascript" src="includes/prototype.js"></script>
			    <script type="text/javascript" src="includes/scriptaculous.js? ¬ load=effects"></script>
			    <script type="text/javascript" src="includes/modalbox.js"></script>
			    <link rel="stylesheet" href="includes/modalbox.css" type="text/css" media="screen" />
			  	<td><img src="images/mast1a.png" BORDER=0 /><img src="images/mast_spacer.png" BORDER=0 /></td>
			  	<td><a href="userSearchSQL.php" title="Unity Search" onclick="Modalbox.show(this.href, {title: this.title, width: 355}); return false;"><img src="images/mast1b.png" BORDER=0 /></a></td>
				    $myCalendarStart = new tc_calendar("calDate", true);
				    $myCalendarStart->setDate(date(j), date(n), date(Y));
			  	<INPUT TYPE=submit NAME=button VALUE="Go">
			  	<table border="0" cellpadding="0" cellspacing="0">
			  	<td><A HREF="javascript:oneDayBack();"><img src="images/mast2.png" BORDER=0 /></a></td>
			  	<td width=284 background="images/mast3.png"><DIV ALIGN=CENTER><FONT COLOR="#e9e9e9"><br><b><font size="5" face="Arial"><? print $_SESSION["searchCriteria"] ?></b></FONT></td>
			  	<td><A HREF="javascript:oneDayAhead();"><img src="images/mast4.png" BORDER=0 /></a></td>

Open in new window

1 Solution
Modify the day of the month's <a> tag to include onclick="this.form.submit();return false;"

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now