Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.