paulmason411
Posts: 127
|
| Posted: 08/14/2008, 12:17 AM |
|
Hi Guys,
I have some custom code to insert a database record when the user submits a form. I was trying to retrieve a value from a label by: label->GetValue() However when I try this it returns NULL.
I'm guessing the GetValue function only works on events such as 'Before Show'.
Does anyone have a way of retrieving a forms label value using custom code from the On Click?
Cheers.
_________________
http://paulmason.name - Web Development Blog
|
 |
 |
wkempees
Posts: 1679
|
| Posted: 08/14/2008, 4:08 AM |
|
$Container->label->GetValue()
See: Help File or Docs, search for "Referencing Objects"
$Container, literaly
label, replace by name of your label
OR
$Formname->label->GetValue()
$Formname, replace by name of your RecordForm
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)
if you liked this info PAYPAL me: http://donate.consultair.eu
|
 |
 |
paulmason411
Posts: 127
|
| Posted: 08/14/2008, 5:06 AM |
|
Ohh yeah I know to use $Container->label->GetValue() I was just abbreviating in the first post.
I get a value when using custom code in the 'Before Show' event. However when I use the exact same code with the 'On Click' event I get NULL.
_________________
http://paulmason.name - Web Development Blog
|
 |
 |
wkempees
Posts: 1679
|
| Posted: 08/14/2008, 5:14 AM |
|
On Click, server or client side?
Oh well does not really matter, I just realize you are talking Labels.
Just as a test, change it to a textbox, it will work.
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)
if you liked this info PAYPAL me: http://donate.consultair.eu
|
 |
 |
jhutch
Posts: 1
|
| Posted: 08/14/2008, 1:50 PM |
|
I've been trying to get this to work as well, currently to no avail.
I have a page with 3 forms (Form1, Form2, Form3).
In Form1 I have a textbox containing a value from a database.
In Form2 I have a textbox that updates a database on clicking the submit button.
In Form3 I have a button in which I attach a Server On Click code.
In the Form3 code I attempt to grab information from the textbox in Form1 and Form2 using:
$global Form1
$global Form2
echo $Form1->textbox->GetValue() //Gives me an NULL
echo $Form2->textbox->GetValue() //Gives me information
I can't seem to figure this out, I'm very very confused.
|
 |
 |
paulmason411
Posts: 127
|
| Posted: 08/14/2008, 5:02 PM |
|
Thanks Walter,
It works fine when I use a textbox.
jhutch,
Try changing your code from this:
$global Form1
$global Form2
To this:
global $Form1
global $Form2
Let me know if that helps.
_________________
http://paulmason.name - Web Development Blog
|
 |
 |
wkempees
Posts: 1679
|
| Posted: 08/14/2008, 5:35 PM |
|
If a Form is not submitted, it's data does not get posted, therefore it is not available.
In the case of the three forms only the data of the submitted form will be available.
Labels, are displayed data values, they are not posted and are therefore not available.
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)
if you liked this info PAYPAL me: http://donate.consultair.eu
|
 |
 |
|