www.webdeveloper.com
Results 1 to 3 of 3

Thread: Contact 7 Form field and Javascript

  1. #1
    Join Date
    Apr 2014
    Posts
    36

    Contact 7 Form field and Javascript

    I have a form that I have working here - http://www.webcrawldesigns.com/dct/order-form-new

    To make a field mandatory I need to add the field in this format [text *width1]
    My problem is that to make my 2 fields required and keeping the javascript working..

    Code
    [text* width1 class:short onchange="Calculate(1)"]
    [text* length1 class:short onchange="Calculate(1)"]
    <input class="short" onfocus="this.form.elements[0].focus()" name="totalcost1" id="totalcost1" />

    **when they were input code they worked but I need to add * with square brackets around to set as required field prior to submission. Any ideas?
    Thank you.

  2. #2
    Join Date
    Jan 2005
    Posts
    357
    Could you please explain what is going wrong here? My first thought is that you probably can't get away with using the same function, ie
    Calculate(1)
    for two different fields.

  3. #3
    Join Date
    Apr 2014
    Posts
    36
    the javascript function works fine but I need these two fields to be required before submitting the form.
    Contact form code is [text* fieldnameexample]
    when someone submits if the fieldnameexample does not have content in it an error will come up required field. When I change my width and height to the contact form format my javascript function doesn't work.
    Not sure how to make it all work together or maybe I need some direction on forcing field using another javascript function?

    working - http://www.webcrawldesigns.com/dct/order-form

    contact form required format javascript not working - http://www.webcrawldesigns.com/dct/order-form-new

    thanks

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles