CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Hide a textbox based on the value selected from a listbox

Print topic Send  topic

Author Message
Lizam
Posted: 01/25/2005, 3:11 AM

Can anyone shed some light why below code doesn't work?

onChange event of a listbox (editable grid):

var g_val = document.forms["form1"].listbox1.options[document.forms["form1"].listbox1.selectedIndex].value;

if (g_val == "2")
{
document.forms["form1"].textbox1.style.visibility = "visible";
}
else
{
document.forms["form1"].textbox1.style.visibility = "hidden";
}

Thanks for any input.
aakici


Posts: 49
Posted: 01/25/2005, 2:33 PM

try this :

document.DocumentName.TextBoxName.style.visibility = "hidden";
_________________
Regards,
M.Alpaslan AKICI
View profile  Send private message
aakici


Posts: 49
Posted: 01/25/2005, 2:38 PM

or you may not be able to get listbox value. try this :
document.forms["form1"].listbox1.options[document.forms["form1"].listbox1.selectedIndex].value
option=document.forms["form1"].listbox1.options[document.forms["form1"].listbox1.selectedIndex].value
g_val=option;
if (g_val == "2")
{
document.forms["form1"].textbox1.style.visibility = "visible";
}
else
{
document.forms["form1"].textbox1.style.visibility = "hidden";
}

_________________
Regards,
M.Alpaslan AKICI
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.