Welcome to TalkGraphics.com
Results 1 to 10 of 11

Thread: Form validation

Hybrid View

  1. #1
    Join Date
    Aug 2015
    Location
    A galaxy far far away
    Posts
    257

    Default Form validation

    Hello all,

    I have created a form in 3 variants, simple name and e-mail. I have also created some javascript validation to ensure name and e-mail are not left empty when the form is submitted. For the first variant, i.e. where the name is first in the HTML source everything works fine, but on the 2nd and 3rd variants the validation keeps kicking in even though I fill in the fields. Presumable it see the first variants name field as empty.

    How can I apply validation to forms without having to give each name/email field a unique id and then duplicating the validation code three times?

  2. #2
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,854

    Default Re: Form validation

    Quote Originally Posted by nazf355 View Post
    Hello all,

    I have created a form in 3 variants, simple name and e-mail. I have also created some javascript validation to ensure name and e-mail are not left empty when the form is submitted. For the first variant, i.e. where the name is first in the HTML source everything works fine, but on the 2nd and 3rd variants the validation keeps kicking in even though I fill in the fields. Presumable it see the first variants name field as empty.

    How can I apply validation to forms without having to give each name/email field a unique id and then duplicating the validation code three times?
    I have used hidden fields in the past for tracking entered data across different pages so a similar technique may be needed here.

    Personally, I would place the form in a sub-folder/sub-site as a stand-alone page and embed it as an IFRAME - three views into one form. Not tried it though so let us know if it works.

    Acorn
    Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
    When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat

  3. #3
    Join Date
    Aug 2015
    Location
    A galaxy far far away
    Posts
    257

    Default Re: Form validation

    Quote Originally Posted by Acorn View Post
    I have used hidden fields in the past for tracking entered data across different pages so a similar technique may be needed here.

    Acorn

    Can you expand a little bit more on this please?

  4. #4
    Join Date
    Apr 2012
    Location
    SW England
    Posts
    17,854

    Default Re: Form validation

    What form widget are you using or it is your own design?
    Acorn
    Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
    When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat

  5. #5
    Join Date
    Aug 2015
    Location
    A galaxy far far away
    Posts
    257

    Default Re: Form validation

    Quote Originally Posted by Acorn View Post
    What form widget are you using or it is your own design?
    Acorn
    It's my own.

  6. #6
    Join Date
    Aug 2000
    Location
    Harwich, Essex, England
    Posts
    21,925

    Default Re: Form validation

    Personally, I would place the form in a sub-folder/sub-site as a stand-alone page and embed it as an IFRAME - three views into one form. Not tried it though so let us know if it works.
    That's the way to go. I've used it and it works very well. I'll try and post a xar file later today.

    Here's a form within an iframe. It's optimised for a mobile but should work in any a supersite.

    http://parkeston.com/forms/form-in-an-iframe.htm
    Last edited by Egg Bramhill; 15 September 2015 at 04:21 AM.
    Egg

    Intel i7 - 4790K Quad Core + 16 GB Ram + NVIDIA Geforce GTX 1660 Graphics Card + MSI Optix Mag321 Curv monitor
    + Samsung 970 EVO Plus 500GB SSD + 232 GB SSD + 250 GB SSD portable drive + ISP = BT + Web Hosting = TSO Host

 

 

Tags for this Thread

Bookmarks

Posting Permissions

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