I wrote a simple piece of java that for a radio button that will show another set of radio buttons if you select "yes" or it will hide them if you select "no".
Then I put it in a PHP loop that writes the java per row.
However, when PHP writes it, it doesn't work. If I create it in HTML with Javascript it works fine.
Here is the html/javascript (that works)
<div id='showbutton[1]' >
YES<input type="radio" name="press1" value="1" />NO<input type="radio" name="press1" value="2"/>
</div>
<p>YES
<input type="radio" name="press" value="1" onclick="MM_showHideLayers('showbutton[1]','','show')" />
NO
<input type="radio" name="press" value="2" onclick="MM_showHideLayers('showbutton[1]','','hide')" />
</p>
<p>
<div id='showbutton[2]' >
YES<input type="radio" name="press1" value="1" />NO<input type="radio" name="press1" value="2"/>
</div>
</p>
<p>
Yes<input type='radio' name='press' value='1' onclick="MM_showHideLayers('showbutton[2]','','show')">
No<input type='radio' name='press' value='2' onclick="MM_showHideLayers('showbutton[2]','','hide')">
Here is the same code in a PHP echo statement. it echo's just fine onto the screen, however the java doesn't work.
<?php
echo "
<div id='showbutton[1]' >
YES<input type='radio' name='press1' value='1' />NO<input type='radio' name='press1' value='2'/>
</div>
<p>YES
<input type='radio' name='press' value='1' onclick='MM_showHideLayers('showbutton[1]','','show')' />
NO
<input type='radio' name='press' value='2' onclick='MM_showHideLayers('showbutton[1]','','hide')' />
</p>
<p>
<div id='showbutton[2]' >
YES<input type='radio' name='press1' value='1' />NO<input type='radio' name='press1' value='2'/>
</div>
</p>
<p>
Yes<input type='radio' name='press' value='1' onclick='MM_showHideLayers('showbutton[2]','','show')'>
No<input type='radio' name='press' value='2' onclick='MM_showHideLayers('showbutton[2]','','hide')'>
";
?>
Then I put it in a PHP loop that writes the java per row.
However, when PHP writes it, it doesn't work. If I create it in HTML with Javascript it works fine.
Here is the html/javascript (that works)
<div id='showbutton[1]' >
YES<input type="radio" name="press1" value="1" />NO<input type="radio" name="press1" value="2"/>
</div>
<p>YES
<input type="radio" name="press" value="1" onclick="MM_showHideLayers('showbutton[1]','','show')" />
NO
<input type="radio" name="press" value="2" onclick="MM_showHideLayers('showbutton[1]','','hide')" />
</p>
<p>
<div id='showbutton[2]' >
YES<input type="radio" name="press1" value="1" />NO<input type="radio" name="press1" value="2"/>
</div>
</p>
<p>
Yes<input type='radio' name='press' value='1' onclick="MM_showHideLayers('showbutton[2]','','show')">
No<input type='radio' name='press' value='2' onclick="MM_showHideLayers('showbutton[2]','','hide')">
Here is the same code in a PHP echo statement. it echo's just fine onto the screen, however the java doesn't work.
<?php
echo "
<div id='showbutton[1]' >
YES<input type='radio' name='press1' value='1' />NO<input type='radio' name='press1' value='2'/>
</div>
<p>YES
<input type='radio' name='press' value='1' onclick='MM_showHideLayers('showbutton[1]','','show')' />
NO
<input type='radio' name='press' value='2' onclick='MM_showHideLayers('showbutton[1]','','hide')' />
</p>
<p>
<div id='showbutton[2]' >
YES<input type='radio' name='press1' value='1' />NO<input type='radio' name='press1' value='2'/>
</div>
</p>
<p>
Yes<input type='radio' name='press' value='1' onclick='MM_showHideLayers('showbutton[2]','','show')'>
No<input type='radio' name='press' value='2' onclick='MM_showHideLayers('showbutton[2]','','hide')'>
";
?>