Hi All,
I have a problem. See the following code
<form name="profilecapture">
<?php
$required = true;
?>
FNAME
<?
if($required==true){
echo "<span id=\"a\">*</span>";
}
?>
:<input type="text" name="fname">
<input id = "11" type="checkbox" onClick="showhide('a','11');">
<script language="javascript" type="text/javascript">
function showhide(id,id1){
var chk = document.getElementById(id1).checked;
var makemandatory;
if(document.getElementById(id1).checked){
makemandatory = true;
document.getElementById(id).style.visibility = "visible";
document.profilecapture.abc.value="true";
}else{
makemandatory = false;
document.getElementById(id).style.visibility = "hidden";
document.profilecapture.abc.value="false";
}};
</script>
<input type="text" name="abc">
</form>
What I'm doing here is,
If required is true
then dispaly
else
do not display
Now what I want is I need to display the * if required is true & chk box is selected. To do this I'm taking the value of chkbox (selected or not) to a hidden field abc. But I ned to use this value in the above condition.
So the condition looks like
If required is true or chkbox is selected i.e abc==true
then dispaly
else
do not display
How to do this.
Can some one plz help me in this. I badly need this. My customer is waiting