www.webdeveloper.com
Results 1 to 2 of 2

Thread: multipul form expansions

Hybrid View

  1. #1

    Exclamation multipul form expansions

    Hi guys,

    I am doing quite a complex application form, for part of it I need my users to select one radio button from 3 and to then be displayed with more options depending on which they chose, this is easy enough, but i need them to be able to do this several times, for example question 1 has 3 options that branch to 3 sets of 3 options...question 2 has 4 options that brances to 4 sets of 2 options...make sense? difficult to explain.. so iv got a code which works fine for a single expansion but as soon as i try to add another question, i get stuck as the javascript is name dependant...any ideas how i could rewrite this javascript so that it could include multipul names for multipul questions?

    here is the code:
    Code:
    function hideAll(){
    tag = document.getElementsByTagName("div");
    	for(x=0;x<tag.length; x++){
    		if(tag[x].getAttribute('id').indexOf("loc_") != -1){
    			tag[x].style.display = "none";
    		}
    	}
    }
    
    function show(id){
    el = document.getElementById('loc_' + id.value);
    		hideAll();
    		el.style.display = "block";
    }
    if you could write the exact code out it would be very appreciative, as im not great at writting javascript.

    Thanks for any and all help,

    Mike
    Mike Oram
    Elite Web-Creation
    Design Innovation Guaranteed
    www.eliteweb-creation.co.uk

  2. #2
    50+ people have looked at my thread and no replies? is it really that difficult or am i just being stupid here? lol
    Mike Oram
    Elite Web-Creation
    Design Innovation Guaranteed
    www.eliteweb-creation.co.uk

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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