Ok. I have tried about 20 different methods, but can't seem to get the datepicker button to be at the end of the text input box. What I have done is to implement the datepicker class from Stefan Gabos (great class). It works just fine (I just made a function and call the function when needed. The problem is with the layout of the html form that it is a part of. I want the button to be to the right of the text input box. I have included the current code for the form, the form function, and the showdate function (datepicker). Any help would be greatly appreciated. I have about pulled my hair out on this.
Thanks in advance.
LJ
LJ Wilson
My personal saying - Just remember, it can always get worse, and usually will.
Code:
// form
echo userform2 ('<b>Expiration Date (YYYY-MM-DD)</b>', '<input type="text" size="25" id="date_expired" name="date_expired" value="' . $form['date_expired'] . '" maxlength="10">', showdate("date_expired") );
Code:
// showdate function
function showdate($dategiven)
{
// include the class
require "./datepicker/class.datepicker.php";
// instantiate the object
$dp=new datepicker();
?>
<input type="button" value="Select" onclick="<?=$dp->show($dategiven)?>">
<?
}
Code:
// userform2 function
function userform2 ( $name, $field, $dateformat, $required = '' )
{
$output = '
<tr>
<td width="30%" align="right" valign="top">
' . $name;
// If the field is required we add the red asterisk
if ($required == '1')
$output.= ' <span class="warning">*</span> ';
$output.= '
</td>
<td width="70%" align="left" valign="top">
' . $field . '
' . $dateformat . '
</tr>
</td>
';
return $output;
}
Thanks in advance.
LJ
LJ Wilson
My personal saying - Just remember, it can always get worse, and usually will.