rado
Posts: 221
|
| Posted: 10/17/2009, 10:46 AM |
|
Hi,
I have a record which has 4 controls. I set all of them to be required fields in insert mode., However in edit mode I have to hide 2 controls. When I run update I got expected error message that these two hidden controls are required. Is there any way dynamically change the the requirements for control. something like:
if ($form->EditMode) {
$form->control1->required = false
}
Thanks,
Rado
|
 |
 |
Gena
Posts: 591
|
| Posted: 10/17/2009, 2:04 PM |
|
check you email
_________________
Gena |
 |
 |
damian
Posts: 838
|
| Posted: 10/18/2009, 5:31 AM |
|
question - if the fields are required in insert then they must be present in update?
_________________
if you found this post useful take the time to help someone else.... :)
|
 |
 |
rado
Posts: 221
|
| Posted: 10/18/2009, 5:39 AM |
|
Thanks Damian,
The 2 required fields in insert mode are hidden (In hidden panel) in edit mode, so when I do the update I would like to make sure that 2 hidden controls are not changed.
Rado
|
 |
 |
datadoit
|
| Posted: 10/18/2009, 6:50 AM |
|
The way we handle this is to have an accompanying hidden field. When
the form is submitted, the value from the display field (or dynamically
hidden field) is copied to the hidden field. The hidden field is set to
Required.
The field values are copied in the form's Client OnSubmit event.
document.forms["YourForm"].HiddenField.value = document.forms["YourForm
"].DynamicField.value;
|
|
|
 |
rado
Posts: 221
|
| Posted: 10/18/2009, 7:01 AM |
|
Very interesting.
Let me try it.
Thanks,
Rado
|
 |
 |