Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hidden Field

Status
Not open for further replies.

svsuthar1

Programmer
Jul 6, 2004
135
US
Hi All,

I am working on a page that is has date field that once it submits goes to the same page and hides itself and create a hidden field with it's value.

I have the following code right now... How can I make it work the way I have stated above...

<FORM NAME=getDailyLogTime METHOD=post ACTION="getMailLog.asp"><BR>
<TABLE align=center cellSpacing=0 cellPadding=1 border=1 bordercolor="#cccccc" style="BORDER-COLLAPSE: collapse">
<TR>
<TD bgcolor=navy align=middle colspan=2><FONT color=white><B>Daily Mail Log</B></FONT></TD></TR>
<TR>
<TD><B>Date</B></TD><TD><Input type="text" class="INPUTTEXT" style="text-align:center" id="Date" name="Date" size=10 Value=<%Response.write Date%> maxlength=10>&nbsp;<A href="javascript:ShowDate('getDate_Category.Date',this.getDate_Category.Date.value)"><IMG src="..\images\help.gif" align=center border="0"></A></TD></TR>
</TABLE><BR>
<CENTER><INPUT Type=button Value=Submit OnClick="Validate">&nbsp;<INPUT type=reset value=Reset></CENTER>
</FORM></BODY></HTML>

 
Hi svsuthar1, try this:
Code:
<%
'remember to name your submit button = btnSubmit
Dim HideDate
If Len(Request("btnSubmit"))>0 Then
   HideDate = "OK"
End If
%>

<FORM NAME=getDailyLogTime METHOD=post ACTION="getMailLog.asp"><BR>
<TABLE align=center cellSpacing=0 cellPadding=1 border=1 bordercolor="#cccccc" style="BORDER-COLLAPSE: collapse">    
    <TR>
        <TD bgcolor=navy align=middle colspan=2><FONT color=white><B>Daily Mail Log</B></FONT></TD></TR>
    <TR>
        <TD><B>Date</B></TD><TD>
<!--modified code-->
<Input <%If HideDate="OK" Then%>type="text"<%Else%>type="hidden"<%End If%> class="INPUTTEXT" style="text-align:center" id="Date" name="Date" size=10 Value=<%Response.write Date%> maxlength=10>

&nbsp;<A href="javascript:ShowDate('getDate_Category.Date',this.getDate_Category.Date.value)"><IMG src="..\images\help.gif" align=center border="0"></A></TD></TR>  
</TABLE><BR>
<CENTER><INPUT name=btnSubmit Type=button Value=Submit OnClick="Validate">&nbsp;<INPUT type=reset value=Reset></CENTER>
</FORM></BODY></HTML>

-kendel
 
Thanks Kendel... I have modified to fit me, but the concept helped.

Samir
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top