Hello,
I am building a survey and I need to disable certain form elements when a selection is made in a radiobutton group. I am using Php and mysql. I have written a function in javascript that I thought would disable the needed elements but it will not. Here is the javascript code:
function disable_enable(){
if(document.survey.tspdata.value=="Vector"
{
document.survey.GeoTIFF.disabled=true;
document.survey.ESRI_BIL.disabled=true;
document.survey.ASCII_Grid.disabled=true;
document.survey.ENVI.disabled=true;
document.survey.ERDAS.disabled=true;
document.survey.PCI.disabled=true;
document.survey.Tiff_tfw.disabled=true;
}else if(document.survey.tspdata.value=="Raster"
{
document.survey.ESRI_GeoData_Base.disabled=true;
document.survey.ESRI_shape.disabled=true;
document.survey.ESRI.e00.disabled=true;
document.survey.DXF.disabled=true;
document.survey.DWG.disabled=true;
document.survey.DGN.disabled=true;
document.survey.Intergraph_GeoMedia_Access_Warehouse.disabled=true;
document.survey.Intergraph_Microstation.disabled=true;
document.survey.MapInfo_Tab.disabled=true;
document.survey.MapInfo_Mif_Mid.disabled=true;
}
}
//end of code
I call this in my html code as : <input name="tspdata" type="radio" value="Vector" onSelect="disable_enable()">
It seems to me that the script is not obtaining the value in the field tspdata. I was wondering if I need to pass the value to my url, but the problem with this is that I don't want to hit the submit button to do so. When I hit the submit button I want to make an insert into a database. Can someone please enlighten me on what is going on and then help me correct this problem.
Thank you in advance!
I am building a survey and I need to disable certain form elements when a selection is made in a radiobutton group. I am using Php and mysql. I have written a function in javascript that I thought would disable the needed elements but it will not. Here is the javascript code:
function disable_enable(){
if(document.survey.tspdata.value=="Vector"
document.survey.GeoTIFF.disabled=true;
document.survey.ESRI_BIL.disabled=true;
document.survey.ASCII_Grid.disabled=true;
document.survey.ENVI.disabled=true;
document.survey.ERDAS.disabled=true;
document.survey.PCI.disabled=true;
document.survey.Tiff_tfw.disabled=true;
}else if(document.survey.tspdata.value=="Raster"
document.survey.ESRI_GeoData_Base.disabled=true;
document.survey.ESRI_shape.disabled=true;
document.survey.ESRI.e00.disabled=true;
document.survey.DXF.disabled=true;
document.survey.DWG.disabled=true;
document.survey.DGN.disabled=true;
document.survey.Intergraph_GeoMedia_Access_Warehouse.disabled=true;
document.survey.Intergraph_Microstation.disabled=true;
document.survey.MapInfo_Tab.disabled=true;
document.survey.MapInfo_Mif_Mid.disabled=true;
}
}
//end of code
I call this in my html code as : <input name="tspdata" type="radio" value="Vector" onSelect="disable_enable()">
It seems to me that the script is not obtaining the value in the field tspdata. I was wondering if I need to pass the value to my url, but the problem with this is that I don't want to hit the submit button to do so. When I hit the submit button I want to make an insert into a database. Can someone please enlighten me on what is going on and then help me correct this problem.
Thank you in advance!