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

 Hidden Field Not Updating/Inserting

Print topic Send  topic

Author Message
manuel

Posts: 48
Posted: 04/18/2013, 5:47 PM

I set 3 fields to use variables and dates as default values, it works perfectly when these fields are visible, but if I change the visible property to NO, then the value is not saved in the DDBB.

is this a bug in CCS, or Im doing something wrong?

P.D.: leaving the fields visible is not an option
View profile  Send private message
ckroon

Posts: 869
Posted: 04/18/2013, 6:55 PM

How are the Hidden fields getting their Values.. in a Before SHow Event... On Validate Event or on the hidden fields Default value input box?

_________________
Walter Kempees...you are dearly missed.
View profile  Send private message
manuel

Posts: 48
Posted: 04/18/2013, 7:29 PM

The Date Fields (2) use the Default Value Property, the other two use the "Retrieve Value for control" action or the Record Form.

View profile  Send private message
Lucius

Posts: 220
Posted: 04/19/2013, 8:03 AM

If you set a field Visible property to "false" of an INPUT - then it is removed from the page (not hidden). So no control in HTML = no data is passed from this control. This is how it should work and it works like so in your example.

You have few ways to solve this:

1. Use INPUT type = hidden (but this is when you need to hide it from interface - user can see it, and with little effort change the value, in the source HTML). This however means that this INPUT will always will be hidden from interface.

2. Use 2 INPUTs, one visible on UI, one with type = hidden. Populate them both with value and then if UI INPUT is not shown fall back to second INPUT. Again knowledgeable user can see hidden value and even modify it if he goes into HTML source code.

3. Best way - never trust user input, always assume that form data can be compromised to malicious user. If you hide INPUT from UI, do not add INPUT with type = hidden. Fill the value with server-side code. You can do this by CCS (Custom Insert property for example), or directly in code for example Before Execute Insert event.
View profile  Send private message
MichaelMcDonald

Posts: 640
Posted: 04/19/2013, 9:53 AM

Stay mindful that a default value for a date in a text box or hidden field becomes invalid at midnight if the form is loaded prior to that time and not reloaded or page refreshed after midnight and insertion or update happens later.

Best to always retrieve a date/time "on the fly" eg: just prior to record insertion/update even if it means a little extra work via custom code....
_________________
Central Coast, NSW, Australia.

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.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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