Click to See Complete Forum and Search --> : Text boxes
saju_m
01-04-2003, 10:20 PM
Hi,
need one help,
i'm involded in developing a configurable application entry screen and for that i need to make certain textboxes( i mean html "text") visible and invisible in runtime.
what i'm supposed to do for that?
pls help its very urgent.
Thanking You
khalidali63
01-04-2003, 10:32 PM
What do you mean by runtime?
would it be set visible or invisible by some method being called automatically after a certain time period or it will be done by some event generated by user?
khalidali63
01-04-2003, 10:56 PM
I have taken the liberty of assuming what you meant in your post,try the code below and let me know how far off I am from what you actually intended to do..:D
Khalid
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<script>
var flag = true;
function processForm(){
var obj = document.frm;
if(flag){
obj.t1.style.visibility="hidden";
obj.btn1.value="Show Text Field";
flag = false;
}else{
obj.t1.style.visibility="visible";
obj.btn1.value="Hide Text Field";
flag = true;
}
//uncoment line below if need auto visibility/invisiblity action
//setTimeout("processForm()",5000);
}
/*incase you want this to happen automatically without user interaction
then un-comment the line of code below*/
//window.onload=processForm;
</script>
</head>
<body>
<form name="frm">
<input type="text" name="t1">
<input type="Button" name="btn1" value="Hide Text Field" onclick="processForm();">
</form>
</body>
</html>