CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Dinamically change the control requirements?

Print topic Send  topic

Author Message
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
View profile  Send private message
Gena

Posts: 591
Posted: 10/17/2009, 2:04 PM

check you email
_________________
Gena
View profile  Send private message
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.... :)
View profile  Send private message
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
View profile  Send private message
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
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.