Jump to content

Help Me Before I Go Insane!


stikbizkit

Recommended Posts

Ok folks here is the deal.  After two weeks of researching and wracking my brain, I need help and fast.

 

I have a contact form, PHP based and want to do the following:

 

Patent Attorney

Venture Capital Manager or Advisor

Product Designer

Manufacturer

I Have A General Question

 

Say, when I click patent attorney, a list of check boxes appear.  When I check manufacturer, the patent attorney boxes disappear and the options for manufacturer appear.

 

Attached are the forms.

 

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/205436-help-me-before-i-go-insane/
Share on other sites

Well, while this "isn't" the board for it... here's a shot...

 

You can create two checkbox groups and show one or the other:

 

<script type='text/javascript'>
function getCheckboxes(target){
var x = document.getElementsByClassName("checkboxes");
for(i=0;i<x.length;i++){
	if(x[i].getAttribute('rel') == target){
		x[i].style.display = 'inline';
	} else {
		x[i].style.display = 'none';
	}
}
}
</script>

<a href="#" onclick="getCheckboxes('patent');return false;">Patents</a> | <a href="#" onclick="getCheckboxes('manufacturer');return false;">Manufacturer</a>

<form name="some_form">
<input type="checkbox" class="checkboxes" rel="patent" value="1" />
<input type="checkbox" class="checkboxes" rel="patent" value="2" />
<input type="checkbox" class="checkboxes" rel="patent" value="3" />
<input type="checkbox" class="checkboxes" rel="patent" value="4" />
<input type="checkbox" class="checkboxes" rel="patent" value="5" />

<input type="checkbox" class="checkboxes" rel="manufacturer" value="1" />
<input type="checkbox" class="checkboxes" rel="manufacturer" value="2" />
<input type="checkbox" class="checkboxes" rel="manufacturer" value="3" />
<input type="checkbox" class="checkboxes" rel="manufacturer" value="4" />
<input type="checkbox" class="checkboxes" rel="manufacturer" value="5" />
</form>

<script type='text/javascript'>
getCheckboxes("patent");
</script>

 

Edit: Two typos, the above code works perfectly now.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.