Hi , i am working on project in php. I have using a javascript function to hide and show a textfield.
The script is working in the localhost (xamp server). but not works on the live server..
Please help me...
http://www.build-up.in
http://www.itvoyager.com
javascript function not working on live server
Moderator: General Moderators
Re: javascript function not working on live server
And where are we supposed to find this textfield thing you speak of?
Re: javascript function not working on live server
here is the code
Code: Select all
<script type="text/javascript">
function changeFunction(str2)
{
if (str2=="authors")
{
<?php
$re=mysql_query("SELECT COUNT(*) FROM `users`");$n=mysql_result($re, 0);?>
document.getElementById("ch").innerHTML="<input type='text' class='input-short' name='nos' value='<?php echo $n;?>' style='width:100px' readonly/><span > Authors</span>";
}
}
</script>
<form action="" method="POST">
<p>
<label>To</label>
<select class="input-short" name="whom" onchange="changeFunction(this.value)">
<option value="0">select</option>
<option value="authors">All Authors</option>
<option value="readers">All Readers</option>
</select>
</p>
<p id="ch" style="font-weight:bold;">
</p>
</form>Re: javascript function not working on live server
Could you be a little more specific? Also, as requinix already asked, where is this text box? (So we can see for ourselves what's going wrong)shijopj wrote:but not works on the live server..