Jump to content

JS Pop up calendar within a form on a php page


KimberCat

Recommended Posts

Hi,

What we are trying to have is a php page that contains a form requesting info from the user. One of the input boxes is for a date. Our boss wants the user to be able to click on a calendar icon and select the date from the popup calendar. The date is then loaded in the input box - just like on an airlines reservation site. The problem is that this popup calendar function uses a form of it's own and I know that you can't nest forms. For example...

<form>


<div class="mediumtext1"> <strong>Event Date</strong></div>

<div class="note">Please specify the day that the school will be closed/delayed or the day of the event<br>that is being postponed or cancelled.</div>
<br>
<label for="date"> Date &nbsp;<span class="sm">mm/dd/yy</span> </label>

<form name="foo">
<input type="text" name="bar" /><a href="#" onclick="return getCalendar(document.foo.bar);"><img src="calendar.png" border="0" /></a>
</form>
<br>


</form>

This is just the section for the date. I have quite a bit more of input required from the user both before this section and after. The javascript puts the selected date in the input box.
See [a href=\"https://www.zito9.com/test_public/calendar/index.html\" target=\"_blank\"]https://www.zito9.com/test_public/calendar/index.html[/a] I need to put this into a php page that has a form already.

See [a href=\"https://www.zito9.com/test_public/close_info.php\" target=\"_blank\"]https://www.zito9.com/test_public/close_info.php[/a] for the page that we want to modify to have this feature.

Our boss has required the popup calendar for the date selection. Is there a workaround for this?

Thanks, Kimber
Link to comment
Share on other sites

Don't place the date picker in a separate form, just make it another one of the inputs to your form.

I've used the datepicker from [a href=\"http://www.rainforestnet.com/datetimepicker.htm\" target=\"_blank\"]http://www.rainforestnet.com/datetimepicker.htm[/a] and it's ideal for this kind of application. Supports any kind of date format you need.
Link to comment
Share on other sites

[!--quoteo(post=376776:date=May 24 2006, 02:41 PM:name=AndyB)--][div class=\'quotetop\']QUOTE(AndyB @ May 24 2006, 02:41 PM) [snapback]376776[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Don't place the date picker in a separate form, just make it another one of the inputs to your form.

I've used the datepicker from [a href=\"http://www.rainforestnet.com/datetimepicker.htm\" target=\"_blank\"]http://www.rainforestnet.com/datetimepicker.htm[/a] and it's ideal for this kind of application. Supports any kind of date format you need.
[/quote]

Thanks, this did what I needed it to do.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.