lquental
Posts: 15
|
| Posted: 09/28/2004, 6:59 AM |
|
Hello,
How do I post the value of a disabled field (Input) into a table.
The code looks ok, but the value on the table is always posted as Null
Here is a part of my update function:
$this->SQL = "UPDATE docdetail SET "
. "PRODUCT_CODE=" . $this->ToSQL($this->cp["PRODUCT_CODE"]->GetDBValue(), $this->cp["PRODUCT_CODE"]->DataType) . ", "
....
. "TOTAL=" . $this->ToSQL($this->cp["TOTAL"]->GetDBValue(), $this->cp["TOTAL"]->DataType) );
The field TOTAL is the one that has a disabled input.
Thanks for any help,
Luis
|
 |
 |
klwillis
Posts: 428
|
| Posted: 09/28/2004, 8:49 AM |
|
Hi Luis -
Since the field is disabled, CodeCharge Studio will ignore the value
of the field when updating or inserting records - at least that's what
I've seen.
The way I worked around this was to create a hidden field whose
data source is the database field that needs updating, and the
disabled field is set to the value of the hidden field within the 'Before Show' event.
I guess there are several work arounds to this one depending on
what you're trying to achieve by disabling fields.
Also, when you can, make your fields readonly instead of disabled
when possible, this will eliminate the Null postings.
_________________
Kevin Willis, VP/CIO
HealthCare Information Technology Specialist
http://www.nexushealthcare.com
"Fast - Convenient - Quality-Care"
Medical Software Consulting Services
Email : klwillis@nexushealthcare.com
Skype : klwillis2006 |
 |
 |
peterr
Posts: 5971
|
| Posted: 09/28/2004, 8:54 AM |
|
There is no way to do this since HTML specifications don't allow disabled input fields to be submitted. See http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.12.1
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
klwillis
Posts: 428
|
| Posted: 09/29/2004, 10:12 AM |
|
Quote peterr:
Thanks for clarifying.
Making the fields read-only, or providing a hidden field and a label
will work nicely.
_________________
Kevin Willis, VP/CIO
HealthCare Information Technology Specialist
http://www.nexushealthcare.com
"Fast - Convenient - Quality-Care"
Medical Software Consulting Services
Email : klwillis@nexushealthcare.com
Skype : klwillis2006 |
 |
 |
|