How to modify a form field script to make it Required

  • Profile Image
    elehmann81
    Asked on April 08, 2013 at 12:59 PM

    Hello,

     

    I have a an existing "JotForm" For on my website and I'd like to change one of the existing fields to be required.  There are customized sizes, layouts, etc in place and Ideally I'd like to do this wihtout creating a completely new form.  Is there a simple coding change that'll accomblish that.  Hopefully I don't have to start from scratch.  I'd like to require the email field.  Here's the exisitig code:  Thanks, Eli

    <li class="form-line" id="id_7">
      <label class="form-label-left" id="label_7" for="input_7"> Email: </label>
      <div id="cid_7" class="form-input">
      <input type="text" class="form-textbox" id="input_7" name="q7_email" size="31" />
      </div>
     

    </li>

  • Profile Image
    KadeJM
    Answered on April 08, 2013 at 01:38 PM

    The easiest way to do this would be to turn ON the " Requirement " in your form and then re-embed it with the changes you've made.

    However, if you are looking for a way to rescript this via the form's source code you can change out the Input Script -

     

    From: 

     <li class="form-line" id="id_3">

            <label class="form-label-left" id="label_3" for="input_3"> Full Name: </label>

            <div id="cid_3" class="form-input">

              <input type="text" class=" form-textbox" id="input_3" name="q3_fullName" size="25" />

            </div>

          </li>

     

    To:

    <li class="form-line" id="id_3">

            <label class="form-label-left" id="label_3" for="input_3"> Full Name:<span class="form-required">*</span>

            </label>

            <div id="cid_3" class="form-input">

              <input type="text" class=" form-textbox validate[required]" id="input_3" name="q3_fullName" size="25" />

            </div>

     

    You will need to replicate this for the other fields as well to make them take on the Requirement. I have highlighted the scripting that needs to be added to the field scripts to allow this to happen.


     

  • Profile Image
    elehmann81
    Answered on April 08, 2013 at 01:43 PM

    This is tremendously helpful.  Thanks!  I'm guessing I'd only need to make these additions to the individual fields I'd like to be "required", and can avoid changing codes on ones that I'm not concerned about.  Is that correct?  Thanks again, Eli

  • Profile Image
    KadeJM
    Answered on April 08, 2013 at 02:01 PM

    No problem Eli, you are very welcome, and yes that is correct. But if you run into any issues just let us know and we'll help you to get it corrected.

  • Profile Image
    elehmann81
    Answered on April 08, 2013 at 02:05 PM

    It appears to be working for me: http://www.casadoshermanos.com/rates/booknow.html

    Can't tell you helpful that was.  It's tremendously frustrating to get reservation requests from people and not have a way to contact them.  A small oversite initially, but always been too much trouble to fix.  Thanks again for your help.

  • Profile Image
    sidharth_kch
    Answered on April 08, 2013 at 02:10 PM

    @elehmann81

    Glad to know that your issue was resolved.

    Should you have any questions feel free to contact us.

    Thanks,

    Sidharth

  • Profile Image
    Cameron
    Answered on August 20, 2013 at 02:33 AM

    Hi guys,

    please can you help me?

    I have this email form and I want to make mandatory fields throughout the form. I have the names of the input fields in the input areas themselves.

    how can I get this right? in any suggestions are greatly appreciated

     

    http://www.apptech.co.za/

  • Profile Image
    gori-mathew
    Answered on August 20, 2013 at 03:32 AM

    Hi Cameron,

    You can alternatively set the fields as required through the Jotform form builder. As shown in the snapshot below select the field and then click on the fields properties and select the required button to set the field as required.

    Do let us know if you need further assistance.

    Thanks