Can I have a time-only field, OR autofill the date with a previously input date?

  • Profile Image
    uagman
    Asked on October 03, 2011 at 06:58 PM

    For example, I want to have questions that ask the following:

    * Event Date

    * Start Time

    * End Time

    * Call time

    I don't want the person filling out the form to have to keep re-entering the date each time, and right now I can't find a way to delete the date entry (like you can delete the time entry) for the start, end & call time lines.

    So option #1 would be to have it as listed above, with a Date entry line, then 3 different Time entry lines.

    Option #2 would be to have Date & time on every line, but have the subsequent lines get auto-filled with the date that was entered in the first line.

    Option #3 is that they have to enter date & time from scratch on each line. Option #3 is not a good option. :)

    Thanks for any advice you can offer!

    -Dave

  • Profile Image
    mliz
    Answered on October 04, 2011 at 07:11 AM

    Hi Dave,

    Since auto fill of fields according to the entry on the previous  field is not possible. The closest work around I can think of for this issue is to use the option 1. Have a separate date field for Event Date then for the Time fields you may use a text  box. Adding a sub label to the text box on how the format for the time should be added would help users to know how  they enter time data.

    The good thing about this kind of setup is for every submission you can keep track of the values entered per field.

    Hope this helps.

  • Profile Image
    uagman
    Answered on October 04, 2011 at 08:42 PM

    Thanks, Mliz!

  • Profile Image
    mliz
    Answered on October 04, 2011 at 08:56 PM

    Hi,

    Your welcome, feel free to contact us if you have questions.

    Thanks for using JotForm and have a great day!

  • Profile Image
    abajan
    Answered on October 05, 2011 at 07:18 PM

    With due respect to my learned colleague mliz, there's an alternative solution: Use drop downs for the Start Time, End Time and Call Time fields. See this clone I made of your form which you may in turn clone to view its injected CSS.

    Obviously, many of our users wouldn't have the time (nor the inclination) to create 1440 lines of code (1 for each minute of the day) for their "time only" fields. So, I used the handy Find and Replace in Notepad++ to do the task in a relatively short period of time. (I'll make the 24 hour version later ;)

    In case the injected CSS in my clone is not clear, here it is with explanatory comments which can be retained in the code to help you understand what each rule does:

    /* fixed width fonts align the times */
    #input_34,
    #input_35,
    #input_36 {
    font-family:'Courier New',Courier,'Nimbus Mono L',monospace;
    }

    /* puts the date and time fields closer to each other */
    #id_6,
    #id_34,
    #id_35 {
    padding-bottom:0;
    }

    /* repositions Start Time's hover text */
    #id_34 .form-description {
    top:-1px;
    left: 280px;
    }

    /* removes the garish pink background on unfilled required fields */
    .form-line-error {
    background:none repeat scroll 0 0;
    }

    The correct selectors for a specific form can be determined with the help of Firebug. I think most modern browsers also come with developer tools installed by default which can also assist with this task. (Here's a video demonstrating Chrome's developer tools.)

    Tip: If you wish, the address in the notification can be formatted differently.

    Cheers :)

  • Profile Image
    uagman
    Answered on October 07, 2011 at 10:34 AM

    Thank you abajan! I will definitely give that a try!!

  • Profile Image
    abajan
    Answered on October 07, 2011 at 08:43 PM

    Cool. Here's the 24 hour version. Just copy all of the code of your preferred format from the links I've provided and paste it into the Options of the dropdown field.

  • Profile Image
    aytekin
    Answered on March 18, 2013 at 12:32 PM

    Update: Time (only) field is now released!