CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Copying Data - Label Value to textbox

Print topic Send  topic

Author Message
PeterJ


Posts: 90
Posted: 04/14/2005, 12:53 PM

Hi

I have a grid with one value which from the database. Below this a form.

I would like to display the value in a text box in the form when the page opens.

I tried using CCGetParam() without success.

Can anyone suggest the best way to achieve what I want please?

Thanks
View profile  Send private message
peterr


Posts: 5971
Posted: 04/14/2005, 3:31 PM

You probably cannot do this for couple reasons. One, Label values cannot be retrieved, only set. Two, one form may not be able to access values of another form.
I think that it would be easier to retrieve the value that you need from the same source that the Label retrieves it from. Thus instead of trying to obtain Label's value, obtain the same database value that the Label obtains.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
PeterJ


Posts: 90
Posted: 04/15/2005, 4:02 AM

Hello Peterr

Thank you for the advice. This is the scenario. I want the textbox, by default, to display the value retrieved + 1. I've tried several run-arounds without success. For example, the value is accountID (not auto-increment) It persists in the db as for example '25' and therefore the textbox should display '26' Sounds easy doesn't it!

Can you point me in the right direction please?

PeterJ
View profile  Send private message
Nicole

Posts: 586
Posted: 04/15/2005, 5:25 AM

PeterJ,
You can create a Before Show event for a textbox and assign it a new value there. The following Help article should help you:
http://docs.codecharge.com/studio/html/index.html?http:...lValue.html?toc

If you need to use a control value in your calculation then that control should be located on the same form. Otherwise you need to retrieve it from a database.
_________________
Regards,
Nicole
View profile  Send private message
PeterJ


Posts: 90
Posted: 04/15/2005, 6:05 AM

Hi Nicole

Thanks, the BeforeShowEvent will only populate the textbox with the value in the event script. I need to retrieve a value from the database to populate the textbox and it is that which I am struggling with.

Thanks

Peter
View profile  Send private message
Nicole

Posts: 586
Posted: 04/15/2005, 6:08 AM

Use CCDLookUp() function to retrieve a value from a database
The example is available at http://docs.codecharge.com/studio/html/index.html?http:...BValue.html?toc
_________________
Regards,
Nicole
View profile  Send private message
peterr


Posts: 5971
Posted: 04/15/2005, 9:59 AM

BTW, are you able to display non-incremented value in that textbox, like '25'?
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
PeterJ


Posts: 90
Posted: 04/15/2005, 10:15 AM

Yes Peterr, no problem with 'default' values such as '25'. I just need to extract the last entry in a column associated with the primary key passed to the page (e.g. s_myvalue) and add 1 to it.

Peter
View profile  Send private message
peterr


Posts: 5971
Posted: 04/15/2005, 10:18 AM

OK, then possibly you misunderstood the previous suggestion from Nicole, because if I could retrieve any value then I would also use the Before Show event to increase it.
For example:
FormName.TextboxName.Value = FormName.TextboxName.Value +1
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
peterr


Posts: 5971
Posted: 04/15/2005, 10:19 AM

Oops, that was ASP. For PHP probably it would be:
$FormName->TextboxName.SetValue($FormName->TextboxName->GetValue() +1);
Or something similar (I don't use PHP often).
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
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.