<script language="JavaScript"><!--
function showme(object) {
if (document.layers && document.layers[object])
document.layers[object].vi
else if (document.all) {
document.all[object].style
document.all[object].style
}
}
function hideme(object) {
if (document.layers && document.layers[object])
document.layers[object].vi
else if (document.all)
document.all[object].style
}
//--></script>
<form>
<div id="Text1" style="position: absolute; visibility: hidden;">
<input type="text" name="textbox1">
</div>
<div id="Text2" style="position: absolute; visibility: hidden;">
<input type="text" name="textbox2">
</div>
<%
if Session("yourvar") = 1 then
%>
<script>
showme('text1');
hideme('text2');
</script>
<%
end if
%>
<%
if Session("yourvar") = 2 then
%>
<script>
showme('text2');
hideme('text1');
</script>
<%
end if
%>
</form>
cheers.
Main Topics
Browse All Topics





by: hongjunPosted on 2002-01-26 at 05:54:54ID: 6757813
Why have to do this? You can always create the textbox you want to show and DON'T create the textbox you don't want to show. This makes it more efficient.
Try something like this
<form>
<%
if Session("var") = 1 then
%>
Textbox 1: <input type="text" name="text1">
<%
else
%>
Textbox 2: <input type="text" name="text2">
<%
end if
%>
</form>
hongjun