www.webdeveloper.com
Results 1 to 5 of 5

Thread: How to make a form

  1. #1
    Join Date
    May 2012
    Posts
    7

    How to make a form

    I'm new to JS and need to do the following.

    I will need a select box with the following selections:

    10=Individual
    15=Family
    100=Patron
    300=Patron King
    500=Patron Master
    1000=Patron Grandmaster

    If Individual is selected nothing else needs to happen.

    If Family is selected, a text box appears asking how many members. Needs to only accept up to two numbers.

    If any of the patron selections are made, a question appears with two radio boxes asking if they will be registering any family members. If yes is selected on the one radio box, then the text box appears as for the Family selection. If no is selected, nothing else needs to happen.

    When I say nothing else needs to happen, the user will be completing the rest of the form which does not need any JS.

    I don't need a submit button as the form processor I'm using (ChronoForms) already provides this.

    Thanks for any assistance.

  2. #2
    Join Date
    May 2012
    Posts
    7
    I didn't see a way to edit the post so I'm afraid I am reposting. To make this simpler, is there a way to have a text box appear or be activated if either the family or any patron membership is selected? Skip all the other stuff I was asking about.

    Thanks.

  3. #3
    Join Date
    May 2006
    Location
    Somewhere behind your screen
    Posts
    1,653
    the same question was resolved a couple of days ago. use Search or just look through the forum

  4. #4
    Join Date
    Nov 2007
    Posts
    418
    1- Create the form with all of the possible elements visible.
    2- Place wrappers around everything that will be hidden at one time or another
    3- Update your CSS to hide the things that will start off hidden
    4- To your select box, add
    Code:
    onchange="selMembership(this.options[this.selectedIndex])"
    5- Add a JS function like:
    Code:
    function selMembership(selectedItem) {
      if (selectedItem.value == '15'){
        //do something like
        //document.getElementById('theRadioButtonsWrapper').style.display = 'inline'
      }
    }

  5. #5
    Join Date
    May 2012
    Posts
    7
    Thank you very much!!

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