Formatting onclick <form> action

Posted on 2009-04-23
Last Modified: 2013-12-13
1.  I have a simple PHP page that makes use of a 3rd party popup date picker (  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=", {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

Question by:Kevin_Cain
    1 Comment
    LVL 10

    Accepted Solution

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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Suggested Solutions

    As this topic comes over and over again in different forms, I've finally decided to write a short (yea, right...) article / tutorial about pagination with PHP with MySQL database. There are dozens of these kind of tutorials, I know - I wanted to mak…
    Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit ( and similar technologies have enjoyed wide adoption, making it possib…
    The viewer will learn how to dynamically set the form action using jQuery.
    The viewer will learn how to count occurrences of each item in an array.

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now