This topic is locked

Set Constraints on field

8/22/2005 9:38:12 AM
ASPRunnerPro General questions
Corinne author

Is there a better way to send a message to the user when they enter invalid data into a field? I have 2 issues really.
The first one is there a better way to handle the error message if the user tries to enter alpha data into an int field. Right now just hte generic error screen show up and doesn't really give the user the ability to correct hte error. Is there code to insert and where would I put it?
The second question I have is there a way to set the default value and not allow the user to change the value in the field during add new or edit? I am able to set the default value and have it show up on the add, edit screen but I don't want the users to be able to change it. How can I accomplish that?
Thanks,

Corinne

501229 8/22/2005

You need to set the field as 'READ ONLY' in the asp functions page.
Have a great day,

Bandit

Corinne author 8/22/2005

Thanks for the reply to one of my questions. Anyone have anything to be able to help me with the other question?

Sergey Kornilov admin 8/23/2005

Corinne,
you can set validation types to validate data that users enter on the add/edit page. If field value doesn't match defined format, web page users will see message box saying what need to be changed.
See list of available validation types here.

Corinne author 8/23/2005

When I set the field as "Read Only" then when I view the page nothing shows up. How am I suppose to set this correctly? Say I want to be able to have a name field have a default value of "Sam". So that when the user looks at the page they see Sam and that it's a required field but they are unable to change it at that time. When I set the field to read only then when the user looks at hte screen they totally don't see "Sam"

Sergey Kornilov admin 8/23/2005

Corinne,
no field can be readonly and has a default value at the same time.
How do you plan to edit this field if it's readonly?