Javascript Form Expansion

I am looking to create a form that expands when a checkbox is clicked. The form I am making is for a conference center. There is a checkbox that states "Full Service." If the checkbox is checked I want the form to expand to include other options. For example if checked I want the form to expand and have checkboxes for "Projector," "Drinks," "Microphone," etc. What is the best way to do this? Wouldn't Javascript be the best way and if so how would I do this? Would a lightbox be the best idea? Could this be done dynamically loading the expanded form using php?
LVL 1
NEComputerAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

kerwinsiyCommented:
are you trying to create a expand/collapse functionality using check box. if yes you could try placing the items inside a div, where everytime you trigger a expand/collapse. the div are shown or hide.

0
NEComputerAuthor Commented:
I am not sure if that is exactly what I am creating because I need to collect the data from the form on whether or not the event is "full service." I have created an expand/collapse before using div and css show and hide. This however has been glitchy and don't know how best to create it. Any guidance?
0
hieloCommented:
try:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
 "http://www.w3.org/TR/html4/loose.dtd">
 
<html>
<head>
<title></title>
<script language="JavaScript" type="text/javascript">
<!--
function toggle(eid){
	eid = document.getElementById(eid);
	eid.style.display=eid.style.display=="" ? "none" : "";
}
//-->
</script>
 
</head>
<body>
<input type="checkbox" name="service" value="Full Service" onclick="toggle('FullService')"/>Full Service
<div id="FullService" style="display:none;">
	<div><input type="checkbox" name="service" value="Projector"/>Projector</div>
	<div><input type="checkbox" name="service" value="Drinks"/>Drinks</div>
	<div><input type="checkbox" name="service" value="Microphone"/>Microphone</div>
</div>
</body>
</html>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
NEComputerAuthor Commented:
Thanks for the solution. It works great! I added some sytle to the form and things still work. If I understand it properly, whatever ID I give the control I give to the objects I want the change to apply to. Again I appreciate the support. Thank You.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.