a!dateField( label: "Order Submission Date", /*value: ri!OrderSubmissionDate,*/ value: fn!today(), saveInto: ri!OrderSubmissionDate, required: true ),
Discussion posts and replies are publicly visible
Take a look at the documentation here. It should answer your question.
You can mange this using saveInto on the submit button.
a!formLayout( label: "Form", contents: { a!dateField( label: "Date", labelPosition: "ABOVE", value: ri!theDate, saveInto: ri!theDate, validations: {} ) }, buttons: a!buttonLayout( primaryButtons: { a!buttonWidget( label: "Submit", saveInto:{ a!save(ri!theDate,if(isNull(ri!theDate),fn!today(), ri!theDate)) }, submit: true, style: "PRIMARY" ) }, secondaryButtons: {} ) )
It also seems you want to default to today's date as well.
I will add on to Bob's answer with the following code. Note the updated "value" field for the dateField.
{ a!dateField( label: "Order Submission Date", value: if( isnull(ri!OrderSubmissionDate), fn!today(), ri!OrderSubmissionDate ), saveInto: ri!OrderSubmissionDate, required: true ), a!buttonLayout( primaryButtons: { a!buttonWidget( label: "Submit", saveInto: { a!save( ri!OrderSubmissionDate, if( isnull(ri!OrderSubmissionDate), fn!today(), ri!OrderSubmissionDate ) ) }, submit: true ) } ) }