This topic is locked
[SOLVED]

 Default value not setting

5/3/2011 7:05:20 PM
ASPRunnerPro General questions
B
beachldy author

I have set the default value Now() for a field named DateAdded in the ASPR add form , but it's not working. The date is not displayed when the form opens.
So I'm trying to add code to set the default value so it is seen when the page opens.

Code below is used on BEFORE RECORD ADDED but it's not working either. Field name is "DateAdded".
values["DateAdded"]=now()

return true

BeforeAdd=true

B
beachldy author 5/3/2011

This javascript is not working either
function GetDefaultDate()

{

document.getElementById("DateAdded").value=Date();

}

window.onload=GetDefaultDate;

B
beachldy author 5/3/2011

This is not working either (on BEFORE RECORD ADDED)
values["DateAdded"] = now()

B
beachldy author 5/3/2011

Ok this got resolved, but I had to change the Default ASP Language under IIS to Jscript (gets error), then BACK again to VBScript and the default code worked.

Don't ask me why, but that's what it took to get it to work.