View Single Post
 
Old July 19th, 2006, 11:46 PM
vinod_yadav1919 vinod_yadav1919 is offline
Friend of Wrox
 
Join Date: Oct 2004
Location: delhi, delhi, India.
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hii carrie.mims!!

name="region2" id="region2" changed to name="region21" and name="region22" for * *Make and *Year

below code is working fine.
however you need to put onclick="HideOrShowStuff(0) when you need to disabled all the fields on click of the other radio button
*******************test.html********



<script type="text/javascript">
function HideOrShowStuff(controlToHide)
{

    if (document.getElementById)
    {
            document.getElementById('region1').disabled=true
            document.getElementById('region3').disabled=true
            if(controlToHide==2)
            {
            document.getElementById('region21').disabled=false
            document.getElementById('region22').disabled=false
            }
            else
            {
             document.getElementById('region' + controlToHide).disabled = false;
            document.getElementById('region21').disabled= true;
            document.getElementById('region22').disabled= true;
            }
    }
    else
    {
        alert('Sorry, your browser doesn\'t support this');
    }
}

</script>

<table>
<tr><td>
<form onsubmit="return checkrequired(this)" ENCTYPE="multipart/form-data" method="post" action="../xxx">

<span class="template"> *Your Email </span><br />
<input name="requiredemail" type="text" class="formfield-data" id="email" size="40" />
<br /><br />

<span class="template"> *Dealer Name</span><br />
<input name="requireddealername" type="text" class="formfield-data" id="dealername" size="40" />
<br /><br />

<span class="template"> *Address</span> <span class="template2"> *Zip</span><br />
<input name="requiredaddress" type="text" class="formfield-data" id="address" size="40" maxlength="100" />
<input name="requiredzip" type="text" class="formfield2" id="zip" size="5" maxlength="5" />
<br /><br />

<span class="template">*Quanity</span><br />
<input name="requiredquanity" type="text" class="formfield-data" id="quanity" size="15" maxlength="15" />
<br /><br />

<span class="template">Selected Zip Codes (.xls)</span><br />
<input name="attachment" type="file" class="comments" id="Attachment" size="30" />
<br /><br />

<span class="template"> *List Type </span><img src="../images/question.gif" style="padding-left:5px;" onclick="MM_openBrWindow('../listdescription.html','','width=375,height=500')"/><br />
<input class="formfield-data2" name="List" type="radio" value="Res Plus"/>Res Plus<br />
<input class="formfield-data2" name="List" type="radio" value="Consumer"/>Consumer<br />
<input class="formfield-data2" name="List" type="radio" value="RITAA" onclick="HideOrShowStuff(1)"/>RITAA<br />
<input class="formfield-data2" name="List" type="radio" value="Regular Auto" onclick="HideOrShowStuff(2)"/>Regular Auto<br />
<input class="formfield-data2" name="List" type="radio" value="Garage Predictor" onclick="HideOrShowStuff(2)"/>Garage Predictor<br />
<input class="formfield-data2" name="List" type="radio" value="True Credit" onclick="HideOrShowStuff(1)"/>True Credit<br />
<input class="formfield-data2" name="List" type="radio" value="True Credit w/ Tradelines" onclick="HideOrShowStuff(1)"/>True Credit w/ Tradelines<br />
<input class="formfield-data2" name="List" type="radio" value="Other" onclick="HideOrShowStuff(3)"/>Other
<br /><br />

<span class="template">*Range</span><br />
<input name="region1" id="region1" disabled type="text" class="formfield-data" size="15" maxlength="15" />
<br /><br />

<span class="template">*Year</span><span class="template">*Make</span><br />
<input name="region2" id="region21" disabled type="text" class="formfield-data" size="4" maxlength="4" />
<input name="region2" id="region22" type="text" disabled class="formfield-data" size="15" maxlength="15" />
<br /><br />

<span class="template">*Other</span><br />
<input name="region3" id="region3" disabled type="text" class="formfield-data" size="40" maxlength="100" />
<br /><br />

<input name="submit" type="submit" class="comments" value="Submit" onclick="LimitAttach(this.form, this.form.attachment.value)"/>
</form>

</td></tr>
</table>
**********************
Hope this will help you

Cheers :)

vinod