PDA

View Full Version : Xin's Popup Calendar - Popup When User Enter Field



NoClue
09-11-2006, 11:26 PM
Xin's Popup Calendar
http://www.dynamicdrive.com/dynamicindex6/popcalendar2.htm

Is is possible to have the calendar pop-up when the user enter the field? I'm using this calendar on my site and users are typing in the date and not clicking on the calendar next to it.

Thanks!

jscheuer1
09-12-2006, 06:04 AM
Because this is a pop up window, there is not much you can do. You could launch it onfocus of the text input but most pop up blockers will block that. You could extend the link to include the text input but that will not work in IE - the most popular browser. In IE you can make it work though by setting the onfocus to the the this.parentNode.click(); but, that throws an error and makes the pop up blocker think that it has blocked a pop up (even though it works). Not a very smooth experience for your users. I think there are other pop up calendars that pop up a division, not a window, those would be better for this application.

Try:

http://www.dynamicdrive.com/dynamicindex7/jasoncalendar.htm

codeexploiter
09-12-2006, 06:15 AM
By NoClue
Is is possible to have the calendar pop-up when the user enter the field?

I'm using this calendar on my site and users are typing in the date and not clicking on the calendar next to it.


You could've made your date text field a readonly one so users have to click on the select date link for selecting a date.

You can control those users who skips without entering the date(s) using proper client-side form validation.

jscheuer1
09-12-2006, 06:39 AM
By NoClue
Is is possible to have the calendar pop-up when the user enter the field?

I'm using this calendar on my site and users are typing in the date and not clicking on the calendar next to it.


You could've made your date text field a readonly one so users have to click on the select date link for selecting a date.

You can control those users who skips without entering the date(s) using proper client-side form validation.

All very clever, except what happens for non-javascript enabled browsers? No way to enter the date. Even for javascript enabled browsers, having a date field that you cannot enter a date into without clicking elsewhere (very non-intuitive) is guaranteed to leave quite a number of users scratching their heads.

The script that I mentioned in my last post should be able to force the date into a desired format while not leaving so many people wondering how to use it.

codeexploiter
09-12-2006, 06:44 AM
Hmmm john you are correct I only thought of Java enabled browsers. Sorry about the confusion.



posted by: John
what happens for non-javascript enabled browsers?




posted by: John
http://www.dynamicdrive.com/dynamicindex7/jasoncalendar.htm


If anybody turned off/use non=Javas/javascript in their browsers then i think the solution you suggested is not going to work.

The solution seems to be the HTML form fields through which people can select day, month and year.

Plz let me know if I am wrong

NoClue
09-13-2006, 04:27 PM
Thanks John, that seems to be the better option for what I'm trying to do.