This topic is locked

Checkbox

8/9/2008 9:13:27 AM
ASPRunnerPro General questions
P
Philip author

Hi,
ASPRunnerPro 5.2 / 423

Is it possible to show or hide a checkbox based on the date? In my application someone can subscribe to a series of events; I want ot hide automatically the checkboxes for past events.
Regards,

Philip

P
Philip author 8/12/2008

Hi,

ASPRunnerPro 5.2 / 423

Is it possible to show or hide a checkbox based on the date? In my application someone can subscribe to a series of events; I want ot hide automatically the checkboxes for past events.
Regards,

Philip


Just to give you an "example":

if Date_A is in the past then hide checkbox_field_A else show it.
Any suggestion - thanks

Philip

J
Jane 8/12/2008

Philip,
where do you want to hide checkbox: on the list page or on the add/edit pages?

P
Philip author 8/12/2008

Jane,
to hide: on the add/edit pages

to show: on list/view pages
Philip

J
Jane 8/13/2008

Philip,
this is a two step process

  1. Proceed to the Edit page, switch to HTML mode and wrap the code section with wrappers (in bold) as shown below:
    {if $showcheckbox}

    <TR>

    <TD class=shade width=150>FieldName</TD>

    <TD width=250>

    {build_edit_control field="FieldName" value=$value_FieldName mode="edit"}

    </TD></TR>
    {/if}


2. Now you need to implement BeforeShowEdit event and put the following code there:

str = "select * from TableName where RecordID=" & request.querystring("editid1") & " and DateFieldName>Now()"

Set rstmp = server.CreateObject("ADODB.Recordset")

rstmp.open str,dbConnection
if not rstmp.eof then

smarty.Add "showcheckbox", True

else

smarty.Add "showcheckbox", False

end if
rstmp.close

set rstmp=nothing

P
Philip author 8/14/2008

Jane,

thanks - that helped me and I could make it running.
Regards,

Philip