This coding works fine in the editor's preview screen.....
<html>
<body>
<center> <br />
<br />
<a class="link" href="javascript:showContent('cont1');">Content1</a> |
<a class="link" href="javascript:showContent('cont2');">Content2</a> |
<a class="link" href="javascript:showContent('cont3');">Content3</a>
<div id="prem" class="prem"></div>
</center>
<script language="javascript">
document.write('<form name="form1">')
document.write('<input type="hidden" name="cont1" value="ONE">')
document.write('<input type="hidden" name="cont2" value="TWO">')
document.write('<input type="hidden" name="cont3" value="THREE">')
document.write('</form>')
function showContent(name) {val=name;if(document.all.prem.innerText!=eval('this.document.form1.'+val+'.value'))
{document.all.prem.innerText=eval('this.document.form1.'+val+'.value');}
else {document.all.prem.innerText="";}}
</script>
</body>
</html>
.......however, after I submit it all the single quotes are being changed to ' and the script does not to run as it did in the preview. Please offer some guidance as to how to fix this issue.
<html>
<body>
<center> <br />
<br />
<a class="link" href="javascript:showContent('cont1');">Content1</a> |
<a class="link" href="javascript:showContent('cont2');">Content2</a> |
<a class="link" href="javascript:showContent('cont3');">Content3</a>
<div id="prem" class="prem"> </div>
</center>
<script language="javascript">
document.write('<form name="form1">')
document.write('<input type="hidden" name="cont1" value="ONE">')
document.write('<input type="hidden" name="cont2" value="TWO">')
document.write('<input type="hidden" name="cont3" value="THREE">')
document.write('</form>')
function showContent(name) {val=name;if(document.all.prem.innerText!=eval('this.document.form1.'+val+'.value')) {document.all.prem.innerText=eval('this.document.form1.'+val+'.value');} else {document.all.prem.innerText="";}} </script>
</body>
</html>
<html>
<body>
<center> <br />
<br />
<a class="link" href="javascript:showContent('cont1');">Content1</a> |
<a class="link" href="javascript:showContent('cont2');">Content2</a> |
<a class="link" href="javascript:showContent('cont3');">Content3</a>
<div id="prem" class="prem"></div>
</center>
<script language="javascript">
document.write('<form name="form1">')
document.write('<input type="hidden" name="cont1" value="ONE">')
document.write('<input type="hidden" name="cont2" value="TWO">')
document.write('<input type="hidden" name="cont3" value="THREE">')
document.write('</form>')
function showContent(name) {val=name;if(document.all.prem.innerText!=eval('this.document.form1.'+val+'.value'))
{document.all.prem.innerText=eval('this.document.form1.'+val+'.value');}
else {document.all.prem.innerText="";}}
</script>
</body>
</html>
.......however, after I submit it all the single quotes are being changed to ' and the script does not to run as it did in the preview. Please offer some guidance as to how to fix this issue.
<html>
<body>
<center> <br />
<br />
<a class="link" href="javascript:showContent('cont1');">Content1</a> |
<a class="link" href="javascript:showContent('cont2');">Content2</a> |
<a class="link" href="javascript:showContent('cont3');">Content3</a>
<div id="prem" class="prem"> </div>
</center>
<script language="javascript">
document.write('<form name="form1">')
document.write('<input type="hidden" name="cont1" value="ONE">')
document.write('<input type="hidden" name="cont2" value="TWO">')
document.write('<input type="hidden" name="cont3" value="THREE">')
document.write('</form>')
function showContent(name) {val=name;if(document.all.prem.innerText!=eval('this.document.form1.'+val+'.value')) {document.all.prem.innerText=eval('this.document.form1.'+val+'.value');} else {document.all.prem.innerText="";}} </script>
</body>
</html>