dniwebdesign
04-15-2005, 04:44 AM
function changecontent(which)
{
if(document.addflyer.flyer.value == "add")
{
document.addflyer.uploader.disabled = true;
}
else
{
document.addflyer.uploader.disabled = false;
}
}
Alright... I got 2 different radio buttons which hold the values (I have shown them below). Uploader is a "file" input type. I want to disable if the user selects the remove radio button and I want it enabled (so users can choose a file) if they select the add button.
However the code I have doesn't do squat... if I have the "uploader" file input set as disabled both options enable it. Which should do. What is wrong?
<input type="radio" name="flyer" value="add" onClick="changecontent(this)">
Add Flyer
<input type="radio" name="flyer" value="remove" onClick="changecontent(this)">
Remove Flyer<br>
<br>
<input type="file" name="uploader" size="25" class="textinput">
{
if(document.addflyer.flyer.value == "add")
{
document.addflyer.uploader.disabled = true;
}
else
{
document.addflyer.uploader.disabled = false;
}
}
Alright... I got 2 different radio buttons which hold the values (I have shown them below). Uploader is a "file" input type. I want to disable if the user selects the remove radio button and I want it enabled (so users can choose a file) if they select the add button.
However the code I have doesn't do squat... if I have the "uploader" file input set as disabled both options enable it. Which should do. What is wrong?
<input type="radio" name="flyer" value="add" onClick="changecontent(this)">
Add Flyer
<input type="radio" name="flyer" value="remove" onClick="changecontent(this)">
Remove Flyer<br>
<br>
<input type="file" name="uploader" size="25" class="textinput">