Forum Moderators: open

Message Too Old, No Replies

Hiding a submit button

         

mdiehl

7:08 pm on Jan 26, 2005 (gmt 0)

10+ Year Member



I need to hide my submit button on my asp page. Is there a way to hide the button until I need to let the user see it?

Thanks

dom86

8:15 pm on Jan 26, 2005 (gmt 0)

10+ Year Member



I think this might help


[archives.hwg.org...]

mdiehl

8:39 pm on Jan 26, 2005 (gmt 0)

10+ Year Member



Thank You!
I never used Javascript yet. I'm just starting with ASP. Do you know what she means when she says I would need a browser sniffer for this one (not included here)?

dom86

8:54 pm on Jan 26, 2005 (gmt 0)

10+ Year Member



No sorry I don’t. But read this page this might help, sounds good


[webreference.com...]

mdiehl

9:12 pm on Jan 26, 2005 (gmt 0)

10+ Year Member



Ok Thanks for all your help.

rocknbil

10:24 pm on Jan 26, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm a bit rusty on my ASP, but why can't you do

<%
if condition then
response.write('<input type="submit" value="Submit">');
end if
%>

?

kaled

12:55 am on Jan 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A browser sniffer is a piece of code that detects the type/version of browser that is being used. At least I think that's what it is - I always avoid that type of code.

Kaled.

mdiehl

2:14 pm on Jan 27, 2005 (gmt 0)

10+ Year Member



rocknbil,
I tried your piece of code. I thought it worked the first time I tried it, but then it gave me a syntax error. Here is the code that I am using:

<% If Session("blnEntry") then %>
<input type="submit" name="Submit" value="Submit">
<% Else%>
<%response.write('<input type="submit" value="Submit">');%>
<% End If%>

Thanks for your help!

mdiehl

2:15 pm on Jan 27, 2005 (gmt 0)

10+ Year Member



Thanks Kaled for your help!

pferdestarken

7:52 pm on Jan 27, 2005 (gmt 0)



Remove the ";" from the end of the Response.Write line and that should get rid of your syntax error.

Although, your code is saying "If the blnEntry session variable exists, then display a submit button. Otherwise, display a submit button.". :)

mdiehl

8:40 pm on Jan 27, 2005 (gmt 0)

10+ Year Member



Ok. Thanks.

mdiehl

8:46 pm on Jan 27, 2005 (gmt 0)

10+ Year Member



Someone else suggested that I use this method of code:

<tr id="HideRow"></tr><!--Hide the submit button-->

Then in my CSS do this:

tr#HideRow
{
display: none
}

rocknbil

6:34 pm on Jan 29, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I tried your piece of code.

Toldya' I was rusty, I usually work in perl. :-) Good you found the way. If you're using ASP, the tools are right there to show and hide it as required.