By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,692 Members | 1,825 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,692 IT Pros & Developers. It's quick & easy.

Date Input Calendar

P: 20

I'm building a form for my webpage, and I'm using "Jason's Date Input Calendar" to allow the user to easily enter a date.

Here is the link to the website of the script:
Dynamic Drive DHTML Scripts- Jason's Date Input Calendar

It's all working visually, but I don't know how to fetch the dates from the form when I send the form a script. I don't know how to relate the content (input) to a variable.

Your help is very much appreciated.
Thanks in advance.
Nov 29 '08 #1
Share this Question
Share on Google+
6 Replies

P: 20
Okay. I got this figured out all by myself, and it was embarassingly easy. So, in order to make this post interesting for others, I'll explain what I did. (since it seems impossible to delete the post).

This JSP-script contain a function/method named DateInput, which takes the following parameters:
Expand|Select|Wrap|Line Numbers
  1. DateInput(DateName, Required*, DateFormat*, DefaultDate*)
When fetching the data in PHP, I used a form with method="post". And I stored the variable like this in my script:
Expand|Select|Wrap|Line Numbers
  1. $DateName = $_POST["DateName"];
That's me, noobing around with external scripts :)
Nov 29 '08 #2

Expert 100+
P: 2,364
Thanks for letting us know how you found this out...

I'd say the moment you solve on your own, you've gotten a lot farther and no longer really a newbie, perhaps an Apprentice, like me:-)

Also, I could not add tags for you here, but try adding them in your posts. Be sure to surround CODE with [ ] then /CODE with [ ]

Expand|Select|Wrap|Line Numbers
  2. Your code appears as such, puts it beatifully in a pane for ya:-)
In a bit!
Dec 1 '08 #3

Expert 2.5K+
P: 3,112
Also, I could not add tags for you here,...
Well, I could. ^^

From me too: Thanks for sharing your solution. This could be helpful to others at some point. :-)

Dec 1 '08 #4

P: 20
Hi again.

Thanks for adding the tags :) . Looks better now :)

I have encountered a different problem. (Which I also think I've just solved, lol xD ). But I do have some questions too.

What if the user doesn't have JavaScript (JS) enabled in his/her browser? Then the text fields and the calendar input would disappear. Of course one could assume that most users actually have JS enabled, but this would be escaping a problem instead of actually solving it.

Within my *.php document I import the JS-script like this:

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript" src="calendarDateInput.js"></script>
I read somewhere that if JS was not enabled I could do something like this:

Expand|Select|Wrap|Line Numbers
  1. <noscript>If JavaScipt was not enabled, put alternate non-JavaScript code here</noscript>
Will this work in all browsers? How would this tag behave if I also did a VBScript within the same page?

I also noticed that I wrote JSP in the topic. It should be JavaScript. Then suddenly this discussion does not belong under the category of Java since JavaScript is not really related to Java. Sorry about that.
Dec 1 '08 #5

Expert 2.5K+
P: 3,112
You're welcome of course. :-)
Indeed - also, people using NoScript wouldn't be able to view the site.
From the little JavaScript experience I have, I'd say yes, it will work in all browsers and probobably with VBScript too. (Mind you, I don't know if VBScript will work in all browsers.) But then, I'm no expert in that area.
OK, I've moved it to the JavaScript Forum, but forgot to change that JSP to JavaScript in time. If one of the mods here would do that... Please? ^^

Dec 1 '08 #6

Expert Mod 15k+
P: 16,027
To solve this problem, you can use <noscript> tags, but you could also use unobtrusive JavaScript techniques. What this means is that the JavaScript is separate from the HTML and the page does not depend on JavaScript to display. In other words, it degrades gracefully in browsers where JavaScript is disabled.
Dec 1 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.