...

View Full Version : need help with a simple div hide script



gerble1000
12-14-2011, 07:17 PM
<script type="text/javascript">
function toggleVisibility4(controlId)
{

var z = document.forms["frm_sms"]["phone"].value;

var minimumnum = 10;

var control = document.getElementById(controlId);





if (z.length <= minimumnum)
{

control.style.visibility = "visible";



}
else

{
control.style.visibility = "hidden";
}

</script>

im not sure where im going wrong
i am calling this script from a " onkeyup="toggleVisibility4('arrow')" "

the arrow is a div i am wanting to hide when the input field "phone" on a form id of "frm_sms" has more than 10 characters
any ideas guys

gerble1000
12-14-2011, 07:26 PM
<script type="text/javascript">
function toggleVisibility4(controlId)
{

var z = document.forms["frm_sms"]["phone"].value;

var minimumnum = 10;

var control = document.getElementById(controlId);





if (z.length <= minimumnum)
{

control.style.visibility = "visible";



}
else

{
control.style.visibility = "hidden";
}

</script>

im not sure where im going wrong
i am calling this script from a " onkeyup="toggleVisibility4('arrow')" "

the arrow is a div i am wanting to hide when the input field "phone" on a form id of "frm_sms" has more than 10 characters
any ideas guys

doesnt matter i figured it out

i changed the lot to this

<script type="text/javascript">
function toggleVisibility4(controlId)
{

var z = document.forms["frm_sms"]["phone"].value;

var minimumnum = 10;

var control = document.getElementById(controlId);





if (z.length <= minimumnum)
control.style.visibility = "visible";




else
control.style.visibility = "hidden";

}
</script>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum