Jump to content


Photo

JS Pop up calendar within a form on a php page


  • Please log in to reply
2 replies to this topic

#1 KimberCat

KimberCat
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 24 May 2006 - 06:30 PM

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

#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 24 May 2006 - 06:41 PM

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.
Legend has it that reading the manual never killed anyone.
My site

#3 KimberCat

KimberCat
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 24 May 2006 - 09:06 PM

[!--quoteo(post=376776:date=May 24 2006, 02:41 PM:name=AndyB)--][div class=\'quotetop\']QUOTE(AndyB @ May 24 2006, 02:41 PM) View Post[/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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users