Date Input Calendar

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hgeithus
    New Member
    • Oct 2008
    • 20

    Date Input Calendar

    Hi.

    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.
  • hgeithus
    New Member
    • Oct 2008
    • 20

    #2
    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:
    Code:
    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:
    Code:
    $DateName = $_POST["DateName"];
    That's me, noobing around with external scripts :)
    Last edited by Nepomuk; Dec 1 '08, 07:46 AM. Reason: Added [CODE] tags

    Comment

    • Dököll
      Recognized Expert Top Contributor
      • Nov 2006
      • 2379

      #3
      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 [ ]

      Code:
      Your code appears as such, puts it beatifully in a pane for ya:-)
      In a bit!
      Last edited by Dököll; Dec 1 '08, 02:30 AM. Reason: added remark...

      Comment

      • Nepomuk
        Recognized Expert Specialist
        • Aug 2007
        • 3111

        #4
        Originally posted by Dököll
        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. :-)

        Greetings,
        Nepomuk

        Comment

        • hgeithus
          New Member
          • Oct 2008
          • 20

          #5
          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:

          Code:
          <script type="text/javascript" src="calendarDateInput.js"></script>
          I read somewhere that if JS was not enabled I could do something like this:

          Code:
          <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.
          Last edited by hgeithus; Dec 1 '08, 12:44 PM. Reason: JSP should be JS

          Comment

          • Nepomuk
            Recognized Expert Specialist
            • Aug 2007
            • 3111

            #6
            Originally posted by hgeithus
            Thanks for adding the tags :) . Looks better now :)
            You're welcome of course. :-)
            Originally posted by hgeithus
            Of course one could assume that most users actually have JS enabled, but this would be escaping a problem instead of actually solving it.
            Indeed - also, people using NoScript wouldn't be able to view the site.
            Originally posted by hgeithus
            I read somewhere that if JS was not enabled I could do something like this:

            Code:
            <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?
            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.
            Originally posted by hgeithus
            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.
            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? ^^

            Greetings,
            Nepomuk

            Comment

            • acoder
              Recognized Expert MVP
              • Nov 2006
              • 16032

              #7
              Originally posted by hgeithus
              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.
              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.

              Comment

              Working...