h8ids
04-12-2006, 08:38 PM
Working with dynamic data.
I have a form which submits info from a radio pair and text box. The radio buttons activate and de-activate the text box. (If user picks "Yes" radio button, they are allowed to add additional information.)
Now I want to allow the user to edit the data stored in the database.
I'm able to capture the "Yes / No" response and additional data into text boxes.
But I want the "Yes / No" answer to be presented using radio buttons not a textbox.
Server side code works fine.
Here is what I have so far; the PHP code was added just for reference.
<script>
function enable1(){
if (document.all || document.getElementById){
if (document.form1.test1.disabled==true)
document.form1.test1.disabled=false
else
document.form1.test1.disabled=false
}
}
function disable1(){
if (document.all || document.getElementById){
if (document.form1.test1.disabled==true)
document.form1.test1.disabled=true
else
document.form1.test1.disabled=true
}
}
</script>
<b>4.</b> Lab:
<label for="Yes1"><b>A.)</b> Yes
<input type="radio" name="LaboratoryYesNo" id="Yes1" value="<?php $myrow["LaboratoryYesNo"]?>" onclick="enable1()"></label>
<label for="No1"><b>B.)</b> No
<input checked type="radio" name="LaboratoryYesNo" id="No1" value="<?php $myrow["LaboratoryYesNo"]?>" onclick="disable1()"></label>
I have a form which submits info from a radio pair and text box. The radio buttons activate and de-activate the text box. (If user picks "Yes" radio button, they are allowed to add additional information.)
Now I want to allow the user to edit the data stored in the database.
I'm able to capture the "Yes / No" response and additional data into text boxes.
But I want the "Yes / No" answer to be presented using radio buttons not a textbox.
Server side code works fine.
Here is what I have so far; the PHP code was added just for reference.
<script>
function enable1(){
if (document.all || document.getElementById){
if (document.form1.test1.disabled==true)
document.form1.test1.disabled=false
else
document.form1.test1.disabled=false
}
}
function disable1(){
if (document.all || document.getElementById){
if (document.form1.test1.disabled==true)
document.form1.test1.disabled=true
else
document.form1.test1.disabled=true
}
}
</script>
<b>4.</b> Lab:
<label for="Yes1"><b>A.)</b> Yes
<input type="radio" name="LaboratoryYesNo" id="Yes1" value="<?php $myrow["LaboratoryYesNo"]?>" onclick="enable1()"></label>
<label for="No1"><b>B.)</b> No
<input checked type="radio" name="LaboratoryYesNo" id="No1" value="<?php $myrow["LaboratoryYesNo"]?>" onclick="disable1()"></label>