I have an page that I cant use value of hidden input in if clause. and dont print anything in page. I use this javascript command past days and worke but dont work here. my code is:
<script type="text/javascript">
function ch()
{
alert();
document.write(" brnd = ");
var c=document.getElementById("brnd").value;
document.write(document.getElementById("brnd").value);
document.write(document.forms["br"]["brnd"].value);
}
window.onload=ch();
</script>
</head>
<body >
<form id="br">
<input type="hidden" id="brnd" value="0000pp" />
</form>
<p>Page Description.
</p>
<div id="brands" style="" >
<ul style="height:20% !important;width:90% !important;">
<li><a href="yat.php" style="color:#000">y.t</a></li>
<li><a href="ez.php" style="color:#000">ez</a></li>
<li><a href="ami.php" style="color:#000">am</a></li>
<li><a href="gr.php" style="color:#000"> group iks</a></li>
<li><a href="fr.php" style="color:#000">frtc</a></li>
<li><a href="ar.php" style="color:#000">armco</a></li>
</ul>
</div>
</body>
Where is the problem in your opinion?
=============================================
@Rocket Hazmat: thanks for your note.one problem was place of ch.i move ch to after input and work.but have another problem that i dont know how solved. anyway code work now.thanks all.
document.forms[br"]["brnd"]is a syntax error. You're missing a".