jQuery Show and Hide Checkboxes
I want to show and hide these checkboxes. I have Six Topics and each of those has checkboxes underneath:
So:
Patent Attorney
Venture Capital
Product Designer
Manufacturer
General Questions
Other
Each of these topics has checkboxes underneath. What I want to do is when I click patent attorney, the check boxes show up, when I click say, Product Designer, the Patent Attorney boxes dissapear and the checkboxes for the Product Designer Appear.
Here is the code that I have so far:
<?php
# This block must be placed at the very top of page.
# --------------------------------------------------
require_once( dirname(__FILE__).'/form.lib.php' );
phpfmg_display_form();
# --------------------------------------------------
function phpfmg_form( $sErr = false ){
$style=" class='form_text' ";
?>
<form name="frmFormMail" action='' method='post' enctype='multipart/form-data' onsubmit='return fmgHandler.onsubmit();'>
<input type='hidden' name='formmail_submit' value='Y'>
<div id='err_required' class="form_error" style='display:none;'>
<label class='form_error_title'>Please check the required fields</label>
</div>
<ol class='phpfmg_form' >
<li class='field_block' id='field_0_div'><div class='col_label'>
<label class='form_field'>Name</label> <label class='form_required' >*</label> </div>
<div class='col_field'>
<input type="text" name="field_0" id="field_0" value="<?php phpfmg_hsc("field_0"); ?>" class='text_box'>
<div id='field_0_tip' class='instruction'></div>
</div>
</li>
<li class='field_block' id='field_1_div'><div class='col_label'>
<label class='form_field'>Street Address</label> <label class='form_required' >*</label> </div>
<div class='col_field'>
<input type="text" name="field_1" id="field_1" value="<?php phpfmg_hsc("field_1"); ?>" class='text_box'>
<div id='field_1_tip' class='instruction'></div>
</div>
</li>
<li class='field_block' id='field_2_div'><div class='col_label'>
<label class='form_field'>City</label> <label class='form_required' >*</label> </div>
<div class='col_field'>
<input type="text" name="field_2" id="field_2" value="<?php phpfmg_hsc("field_2"); ?>" class='text_box'>
<div id='field_2_tip' class='instruction'></div>
</div>
</li>
<li class='field_block' id='field_3_div'><div class='col_label'>
<label class='form_field'>State</label> <label class='form_required' >*</label> </div>
<div class='col_field'>
<?php phpfmg_dropdown( 'field_3', "Alabama|Alaska|Arizona|Arkansas|California|Colorado|Connecticut|Delaware|Florida|Georgia|Hawaii|Idaho|Illinois|Indiana|Iowa|Kansas|Kentucky|Louisiana|Maine|Maryland|Massachusetts|Michigan|Minnesota|Mississippi|Missouri|Montana|Nebraska|Nevada|New Hampshire|New Jersey|New Mexico|New York|North Carolina|North Dakota|Ohio|Oklahoma|Oregon|Pennsylvania|Rhode Island|South Carolina|South Dakota|Tennessee|Texas|Utah|Vermont|Virginia|Washington|West Virginia|Wisconsin|Wyoming", '' );?>
<div id='field_3_tip' class='instruction'></div>
</div>
</li>
<li class='field_block' id='field_4_div'><div class='col_label'>
<label class='form_field'>Zip Code</label> <label class='form_required' >*</label> </div>
<div class='col_field'>
<input type="text" name="field_4" id="field_4" value="<?php phpfmg_hsc("field_4"); ?>" class='text_box'>
<div id='field_4_tip' class='instruction'></div>
</div>
</li>
<li class='field_block' id='field_5_div'><div class='col_label'>
<label class='form_field'>Phone Number</label> <label class='form_required' >*</label> </div>
<div class='col_field'>
<input type="text" name="field_5" id="field_5" value="<?php phpfmg_hsc("field_5"); ?>" class='text_box'>
<div id='field_5_tip' class='instruction'></div>
</div>
</li>
<li class='field_block' id='field_6_div'><div class='col_label'>
<label class='form_field'>Company</label> <label class='form_required' >*</label> </div>
<div class='col_field'>
<input type="text" name="field_6" id="field_6" value="<?php phpfmg_hsc("field_6"); ?>" class='text_box'>
<div id='field_6_tip' class='instruction'></div>
</div>
</li>
<li class='field_block' id='field_7_div'><div class='col_label'>
<label class='form_field'>Email Address</label> <label class='form_required' >*</label> </div>
<div class='col_field'>
<input type="text" name="field_7" id="field_7" value="<?php phpfmg_hsc("field_7"); ?>" class='text_box'>
<div id='field_7_tip' class='instruction'></div>
</div>
</li>
<li class='field_block' id='field_8_div'><div class='col_label'>
<label class='form_field'>Country</label> <label class='form_required' >*</label> </div>
<div class='col_field'>
<?php phpfmg_dropdown( 'field_8', "Afghanistan|Aland Islands|Albania|Algeria|American Samoa|Andorra|Angola|Anguilla|Antarctica|Antigua and Barbuda|Argentina|Armenia|Aruba|Australia|Austria|Azerbaijan|Bahamas|Bahrain|Bangladesh|Barbados|Belarus|Belgium|Belize|Benin|Bermuda|Bhutan|Bolivia|Bosnia and Herzegovina|Botswana|Bouvet Island|Brazil|British Indian Ocean Territory|British Virgin Islands|Brunei|Bulgaria|Burkina Faso|Burundi|Cambodia|Cameroon|Canada|Cape Verde|Cayman Islands|Central African Republic|Chad|Chile|China|Christmas Island|Cocos (Keeling) Islands|Colombia|Comoros|Congo|Cook Islands|Costa Rica|Croatia|Cuba|Cyprus|Czech Republic|Democratic Republic of Congo|Denmark|Disputed Territory|Djibouti|Dominica|Dominican Republic|East Timor|Ecuador|Egypt|El Salvador|Equatorial Guinea|Eritrea|Estonia|Ethiopia|Falkland Islands|Faroe Islands|Federated States of Micronesia|Fiji|Finland|France|French Guyana|French Polynesia|French Southern Territories|Gabon|Gambia|Georgia|Germany|Ghana|Gibraltar|Greece|Greenland|Grenada|Guadeloupe|Guam|Guatemala|Guinea|Guinea-Bissau|Guyana|Haiti|Heard Island and Mcdonald Islands|Honduras|Hong Kong|Hungary|Iceland|India|Indonesia|Iran|Iraq|Iraq-Saudi Arabia Neutral Zone|Ireland|Israel|Italy|Ivory Coast|Jamaica|Japan|Jordan|Kazakhstan|Kenya|Kiribati|Kuwait|Kyrgyzstan|Laos|Latvia|Lebanon|Lesotho|Liberia|Libya|Liechtenstein|Lithuania|Luxembourg|Macau|Macedonia|Madagascar|Malawi|Malaysia|Maldives|Mali|Malta|Marshall Islands|Martinique|Mauritania|Mauritius|Mayotte|Mexico|Moldova|Monaco|Mongolia|Montenegro|Montserrat|Morocco|Mozambique|Myanmar|Namibia|Nauru|Nepal|Netherlands Antilles|Netherlands|New Caledonia|New Zealand|Nicaragua|Niger|Nigeria|Niue|Norfolk Island|North Korea|Northern Mariana Islands|Norway|Oman|Pakistan|Palau|Palestinian Occupied Territories|Panama|Papua New Guinea|Paraguay|Peru|Philippines|Pitcairn Islands|Poland|Portugal|Puerto Rico|Qatar|Reunion|Romania|Russia|Rwanda|Saint Helena and Dependencies|Saint Kitts and Nevis|Saint Lucia|Saint Pierre and Miquelon|Saint Vincent and the Grenadines|Samoa|San Marino|Sao Tome and Principe|Saudi Arabia|Select One|Senegal|Serbia|Seychelles|Sierra Leone|Singapore|Slovakia|Slovenia|Solomon Islands|Somalia|South Africa|South Georgia and South Sandwich Islands|South Korea|Spain|Spratly Islands|Sri Lanka|Sudan|Suriname|Svalbard and Jan Mayen|Swaziland|Sweden|Switzerland|Syria|Taiwan|Tajikistan|Tanzania|Thailand|Togo|Tokelau|Tonga|Trinidad and Tobago|Tunisia|Turkey|Turkmenistan|Turks And Caicos Islands|Tuvalu|US Virgin Islands|Uganda|Ukraine|United Arab Emirates|United Kingdom|United Nations Neutral Zone|United States Minor Outlying Islands|United States|Uruguay|Uzbekistan|Vanuatu|Vatican City|Venezuela|Vietnam|Wallis and Futuna|Western Sahara|Yemen|Zambia|Zimbabwe", '' );?>
<div id='field_8_tip' class='instruction'></div>
</div>
</li>
<li class='field_block' id='field_9_div'><div class='col_label'>
<label class='form_field'>Web Address</label> <label class='form_required' >*</label> </div>
<div class='col_field'>
<input type="text" name="field_9" id="field_9" value="<?php phpfmg_hsc("field_9"); ?>" class='text_box'>
<div id='field_9_tip' class='instruction'></div>
</div>
</li>
<li class='field_block' id='field_10_div'><div class='col_label'>
<label class='form_field'>Description Of Needs</label> <label class='form_required' >*</label> </div>
<div class='col_field'>
<textarea name="field_10" id="field_10" rows=4 cols=25 class='text_area'><?php phpfmg_hsc("field_10"); ?></textarea>
<div id='field_10_tip' class='instruction'></div>
</div>
</li>
<li class='field_block' id='field_11_div'><div class='col_label'>
<label class='form_field'>Patent Attorney</label> <label class='form_required' > </label> </div>
<div class='col_field'>
<?php phpfmg_checkboxes( 'field_11', "General Inquiry|Client Needs Regulatory Information/Advice" );?>
<div id='field_11_tip' class='instruction'></div>
</div>
</li>
<li class='field_block' id='field_12_div'><div class='col_label'>
<label class='form_field'>Venture Capital Manager or Advisor</label> <label class='form_required' > </label> </div>
<div class='col_field'>
<?php phpfmg_checkboxes( 'field_12', "General Inquiry|Client Needs Regulatory Information/Advice" );?>
<div id='field_12_tip' class='instruction'></div>
</div>
</li>
<li class='field_block' id='field_13_div'><div class='col_label'>
<label class='form_field'>Product Designer</label> <label class='form_required' > </label> </div>
<div class='col_field'>
<?php phpfmg_checkboxes( 'field_13', "Conceptual Stage?|Have Drawings?|Have Product Standard(s)?|Prototype Stage?|Designed To Comply With Product Standard(s)?|Have Drawings/Photos?|Prototype Available For Physical Review?|Currently Being Manufactured?|End User/Country Requiring Certification?|Designed To Correct Product Standard(s)?" );?>
<div id='field_13_tip' class='instruction'></div>
</div>
</li>
<li class='field_block' id='field_14_div'><div class='col_label'>
<label class='form_field'>Manufacturer</label> <label class='form_required' > </label> </div>
<div class='col_field'>
<?php phpfmg_checkboxes( 'field_14', "Currently Being Manufactured?|End User/Country Requiring Certification?" );?>
<div id='field_14_tip' class='instruction'></div>
</div>
</li>
<li class='field_block' id='field_15_div'><div class='col_label'>
<label class='form_field'>I Have A General Question</label> <label class='form_required' > </label> </div>
<div class='col_field'>
<?php phpfmg_checkboxes( 'field_15', "General Question/Information" );?>
<div id='field_15_tip' class='instruction'></div>
</div>
</li>
<li class='field_block' id='field_16_div'><div class='col_label'>
<label class='form_field'>Other</label> <label class='form_required' > </label> </div>
<div class='col_field'>
<?php phpfmg_checkboxes( 'field_16', "Other" );?>
<div id='field_16_tip' class='instruction'></div>
</div>
</li>
<li class='field_block' id='field_17_div'><div class='col_label'>
<label class='form_field'>PDF or JPG Attachment Only</label> <label class='form_required' > </label> </div>
<div class='col_field'>
<input type="file" name="field_17" id="field_17" value="" class='text_box' onchange="fmgHandler.check_upload(this);">
<div id='field_17_tip' class='instruction'></div>
</div>
</li>
<li class='field_block' id='phpfmg_captcha_div'>
<div class='col_label'><label class='form_field'>Security Code:</label> <label class='form_required' >*</label> </div><div class='col_field'>
<?php phpfmg_show_captcha(); ?>
</div>
</li>
<li>
<div class='col_label'> </div>
<div class='form_submit_block col_field'>
<input type='submit' value='Submit' class='form_button'>
<span id='phpfmg_processing' style='display:none;'>
<img id='phpfmg_processing_gif' src='<?php echo PHPFMG_ADMIN_URL . 'file:///C|/DOCUME~1/nikkih/LOCALS~1/Temp/Temporary Directory 41 for myform[1].zip/20100621-f7c0/?mod=image&func=processing' ;?>' border=0 alt='Processing...'> <label id='phpfmg_processing_dots'></label>
</span>
</div>
</li>
</ol>
</form>
<?php
phpfmg_javascript($sErr);
}
# end of form
function phpfmg_form_css(){
?>
<style type='text/css'>
body{
margin-left: 18px;
margin-top: 18px;
}
body{
font-family : Verdana, Arial, Helvetica, sans-serif;
font-size : 13px;
color : #474747;
background-color: transparent;
}
select, option{
font-size:13px;
}
ol.phpfmg_form{
list-style-type:none;
padding:0px;
margin:0px;
}
ol.phpfmg_form li{
margin-bottom:5px;
clear:both;
display:block;
overflow:hidden;
width: 100%
}
.form_field, .form_required{
font-weight : bold;
}
.form_required{
color:red;
margin-right:8px;
}
.field_block_over{
}
.form_submit_block{
padding-top: 3px;
}
.text_box, .text_area, .text_select {
width:300px;
}
.text_area{
height:80px;
}
.form_error_title{
font-weight: bold;
color: red;
}
.form_error{
background-color: #F4F6E5;
border: 1px dashed #ff0000;
padding: 10px;
margin-bottom: 10px;
}
.form_error_highlight{
background-color: #F4F6E5;
border-bottom: 1px dashed #ff0000;
}
div.instruction_error{
color: red;
font-weight:bold;
}
hr.sectionbreak{
height:1px;
color: #ccc;
}
<?php
phpfmg_text_align();
echo "</style>\n";
}
# end of css
# By: formmail-maker.com
?>
I have been spinning my wheels for a couple weeks on this and researching countless hours. Any help is greatly appreciated.
Zoho Desk Resources
-
Desk Community Learning Series
-
-
-
-
-
-
-
-
-
Zoho CRM Plus Resources
Zoho Books Resources
Zoho Subscriptions Resources
Zoho Projects Resources
Zoho Sprints Resources
Zoho Orchestly Resources
Zoho Creator Resources
Zoho WorkDrive Resources
Zoho Campaigns Resources
Zoho CRM Resources
Writer Get Started. Write Away!
Writer is a powerful online word processor, designed for collaborative work.