This topic is locked

Adding default date to edit date by combo boxes

2/2/2006 12:01:46 PM
ASPRunnerPro General questions
orit author

I have a date with option to edit (by using the 3 combo boxes and a date picker) that I defined initially without default value. I want to add a default value of now() to this date when the date wasn't set yet. (instead getting the combo boxes empty - I want to get in each combo the Month and the Day and the Year on now) . my application was modified a lot since created by the wizard.. How to do that in the code?
Thanks

admin 2/6/2006

Hi,
Please do some changes in ..._edit.asp file.

See my changes in Bold:

sFieldName = "DateRegistration"

if rs.EOF and rs.BOF then

strValue=""

else

strValue = GetData(rs.Fields(sFieldName), FORMAT_NONE )

end if

if strValue="" then strValue=Now()


when DateRegistration is your actual field name.

orit author 2/6/2006

Perfect.
Thanks a lot