How do I dynamically set a field to readonly if the value fetched from Db is not null .
I am fetching email field value from DB. if the value for this is field is not null then I want the field to be readonly. that means it should only display the email id. if the value returned from the DB is null then the user should have option to enter the value for email id which will be updated in DB for future use.
Kindly suggest how this can be achieved.
TIA
I am fetching email field value from DB. if the value for this is field is not null then I want the field to be readonly. that means it should only display the email id. if the value returned from the DB is null then the user should have option to enter the value for email id which will be updated in DB for future use.
Kindly suggest how this can be achieved.
TIA
HI rasheed1011,
You can use an Event Switcher in the form On Load action to change the CSS for that input. I suggest that you disable the input if the data exists rather than make it readonly as disabled inputs do not submit values.
Bob
You can use an Event Switcher in the form On Load action to change the CSS for that input. I suggest that you disable the input if the data exists rather than make it readonly as disabled inputs do not submit values.
Bob
disabling is not syncing the value in DB.
Hi rasheed1011,
If there is no value for that item then the DB record for that item should be unchanged. By all means use the readonly setting instead though.
Bob
If there is no value for that item then the DB record for that item should be unchanged. By all means use the readonly setting instead though.
Bob
you better use 2 fields, one with readonly attribute another without, and switch them based on the db value!
This topic is locked and no more replies can be posted.
