View Full Version : disable/enable table

08-23-2010, 02:04 AM
can anyone give me some direction on how to disable and enable a table based on there radio button choice.
i have a html form that has all the basics for a product.
the user can get it sent to them or someone else by the choice of radio buttons 1 or 2
after that they can add onto the product before adding it to the cart by passing the info too a asp page and then another asp page.

if they choose not to add on they can go straight to the cart from the first page but i don't want the info labels to pass to the cart if they choose to get it send to them (radio button 1)
radio button 2 opens up(toggles a div) a table to collect the mailing address if it is a gift to someone else. in order for the cart to label the mailing address right i need to use hidden fields for every text box.
back to my issue how do i get the whole table or div (named shipinfo) to disable to it does not post to the cart.

here is what i have so far

<span class="style30" style="text-align:center">Send directly to recipant:</span><input name="product3[]" type="radio" value="{br}{b}SEND CERT DIRECTLY TO RECIPANT---{/b}" onclick="toggle(this, 'shipGroup');"/>

<span class="style30">Send to me to give to the recipant:</span>
<input name="product3[]" type="radio" value="{br}{b}SEND CERT TO ME TO GIVE TO RECIPANT---{/b}" /></center>
<input type="hidden" name="price3" value=".00" />
<input type="hidden" name="qty3" value="1" />
<input type="hidden" name="noqty3" value="3" />
<div id="shipGroup"><table width="616">
<td width="125" style="text-align:left">
<span class="style30">First Name</span>
<input type="hidden" name="product3[]1" value="{br}FIRST NAME:" /></td>
<td width="151"><input type="text" name="product3[]2" value=""/></td>
<td width="147" style="text-align:right"><span class="style30" >Last Name</span>
<input type="hidden" name="product3[]3" value="{br}LAST NAME:" /></td>
<td width="173" style="text-align:left"><input type="text" name="product3[]4" value=""/></td></tr>
<tr><td colspan="3" style="text-align:left"><span class="style30">Address</span>
<input type="hidden" name="product3[]5" value="{br}ADDRESS:" />
<input type="text" name="product3[]6" value="" size="30"/></td>
<tr><td colspan="2" style="text-align:left"><span class="style30">City</span>
<input type="hidden" name="product3[]7" value="{br}CITY:" /><input type="text" name="product3[]8" value=""/></td>
<td><span class="style30">State</span>
<input type="hidden" name="product3[]9" value="{br}STATE:" />
<input type="text" name="product3[]10" value="" size="10"/></td>
<td><span class="style30">Zip code</span>
<input type="hidden" name="product3[]11" value="{br}ZIP CODE:" />
<input type="text" name="product3[]12" value="" size="5"/></td></tr></table>

08-23-2010, 08:26 PM
you're looking at a combination of jquery, css, html, and asp or php. your choice. if you're going down the php path maybe i can help but asp is not for me, sorry.


08-23-2010, 08:35 PM
or coldfusion would do the trick with a cfif statement.

08-24-2010, 02:34 AM
what is a cfif statement.

08-24-2010, 03:27 PM
cfif is a coldfusion tag. If you dont have coldfusion then it wouldnt matter...lol I was throwing out there that probably an if statement would work.

if (one condition is true) do this

else (do this)

Im sure PHP has something similar, as well as most any other client and server side language. I am just familiar with coldfusion because its what I use.