CodeCharge Studio
search Register Login  

Visual Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 php code to get value of text, hidden, label fields

Print topic Send  topic

Author Message
bigtoe

Posts: 115
Posted: 10/20/2004, 4:37 AM

I have a CCS generated data entry form.
It works fine so far.
All the fields came from the database.

Now I need to add 3 fields that are not associated with the database:
1. Text field called text_1
2. Hidden field called hidden_1
3. Label field called label_1

These 3 fields just reside within the form tags.

I would like to create 3 php functions:
get_text_1_value()
get_hidden_1_value()
get_label_1_value()

Each would return the value of the respective field.
Not being a php expert, what php code should I put in each function?

View profile  Send private message
feha


Posts: 712
Posted: 10/21/2004, 2:26 PM

Quote :
I would like to create 3 php functions:
get_text_1_value()
get_hidden_1_value()
get_label_1_value()
:

use
global $form_name

$form_name->text_1->GetValue();
etc ...
or

$myfield=CCGetParam("text_1","");



but form label i'm not sure you can get value
_________________
Regards
feha

www.vision.to
feedpixel.com
View profile  Send private message
bigtoe

Posts: 115
Posted: 10/23/2004, 2:55 AM

Thanks feha.

Yes, GetValue works for text.
The label is a problem even if I give it an id.
View profile  Send private message
mrachow


Posts: 509
Posted: 10/26/2004, 12:46 AM

Do you have created the label using Toolbox | Forms | Label or is it simple Text like the form header is by default?
You are able to say GetValue for a control only.

Regards,
Michael
_________________
Best regards,
Michael
View profile  Send private message
peterr


Posts: 5971
Posted: 10/28/2004, 9:40 AM

It's not possible to read value of a label on the server (PHP) since labels are not submitted with forms. HTML specifications don't allow this.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
mrachow


Posts: 509
Posted: 10/28/2004, 2:20 PM

One idea I have at the moment.
You don't write your label directly into the HTML page but place there:
{labelContent}
Than substitute this by
global $Tpl;
$Tpl->SetValue("labelContent, "ShowingOnPage");

So you can't read the label but could keep its content because you have set it.

Reagrds,
Michael
_________________
Best regards,
Michael
View profile  Send private message
peterr


Posts: 5971
Posted: 10/28/2004, 3:44 PM

Sorry but this still cannot work, at least when trying to read the label value when the form is being processed.
Setting the label value would be done when the script/program is run to show the page, while reading the label's value would be done when the script is run to process submitted data. The script is run 2 different times and the 2nd time the script doesn't know what the same script did the 1st time.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
mrachow


Posts: 509
Posted: 10/28/2004, 11:47 PM

I think I wasn't able to be quite clear.

I see that it is imposible to "read back" a label.
The solution I suggested do not need to retrieve the value of a label because it stores the value(s) in a session variable(s), a global array or something like that.
So the server can't read but knows which label had been show on clients browser because he have all the values.

I thought/think this should work?!

BTW
It had cost me a while until it had become clear that's impossible to read a label.
I have had an editable grid showing a label among other things. On event OnValdation I would like to check an entered value against a value that was shown only (just that lable). At the end I have placed a hidden field beside that label and tied it to the same database column.
This value I was able to read and was able to perform my validation (for every line of the grid).

Thanks for your patience,
Michael
Kindly regards,
Michael
_________________
Best regards,
Michael
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.

MS Access to Web

Convert MS Access to Web.
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.