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

 ::: Setting Value of Label Control

Print topic Send  topic

Author Message
klwillis


Posts: 428
Posted: 05/17/2004, 11:06 AM

I have a form which has a text box control
with the name: {UserName}

When I post the form, I simply want to display
this value on a second form with a label control
having the name: {TheUserName}

When using the 'Retrieve Value for Control' action
on the {TheUserName} label control in order to retrieve
the value of {UserName} from the prior form, what values
do I need to specify for each of these? ...

Source Type : ???
Source Name : ???

_________________
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
View profile  Send private message
peterr


Posts: 5971
Posted: 05/17/2004, 12:43 PM

Source Type : URL or Form (depending on the from setup)
Source Name : UserName
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
klwillis


Posts: 428
Posted: 05/17/2004, 10:23 PM

What do you mean? ... "depending on the from setup".

I still haven't gotten this to work (VERY frustrating!) :(

Please explain.

Quote peterr:
Source Type : URL or Form (depending on the from setup)
Source Name : UserName
:(
_________________
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
View profile  Send private message
peterr


Posts: 5971
Posted: 05/18/2004, 3:12 AM

Sorry, I meant the Form setup. I just don't know what type of form you're using, how it is configured, if it is a form created with CCS, etc. If you tried both options and none worked then obviously my solution didn't help. In this case you probably cannot retrieve the 1st form values within the 2nd page - nothing is being passed.
The PHP programs actually don't automatically pass values to the 2nd page. The 1st page is the one that receives those values from HTML, utilizes them as needed, then redirects the user to the second page URL.
If you're struggling with something please don't hesitate contacting our support.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
klwillis


Posts: 428
Posted: 05/18/2004, 8:05 AM

What I'm trying to do is VERY basic - something CodeCharge should
be able to do in a matter of minutes - and I know it's possible.


Step-1:
Use the CCS Record Form control and create a form with a single
text field control - called {YourName}.


Step-2:
Set the Return Page for the CCS Record Form Control to the
new page which will contain the label control (see below).


Step-3:
Create a second page in CCS, add a lable control to the field -
called {HeresYourName}


Step-4:
Attach the "Retrieve Value for Control" action to the "Before Show"
event for the label control {HeresYourName} such that it is set to
the value {YourName} from the previous form.

The PHP values for the following need to be set appropriately.
Cotntrol Name : HeresYourName (<-- This is the only choice here)
Source Type : ???
Source Name : ???


That's all - this should be VERY simple and is something
used extensively on the web to pass form data from page-to-page,
prior to saving all the results to a database.

After recently purchasing CCS, I'd appreciate at least one FREE example that shows me clearly how to do this.

Please reply with the PHP solution to this.

Have someone from your tech-support staff take the 5-minutes
required to put this sample together and send it to me.

BTW:
Is there a way to automatically synchonize your work in CCS?
It seems even after generating code at times and saving the
work, changes aren't fully applied throughout the application.
This get's very annoying, and I'm hoping there's a setting that
will do this for me so I don't need to worry about it every time I
make page changes.

Your assistance is greatly appreciated.

Regards,

Kevin Willis

Quote peterr:
Sorry, I meant the Form setup. I just don't know what type of form you're using, how it is configured, if it is a form created with CCS, etc. If you tried both options and none worked then obviously my solution didn't help. In this case you probably cannot retrieve the 1st form values within the 2nd page - nothing is being passed.
The PHP programs actually don't automatically pass values to the 2nd page. The 1st page is the one that receives those values from HTML, utilizes them as needed, then redirects the user to the second page URL.
If you're struggling with something please don't hesitate contacting our support.

_________________
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
View profile  Send private message
peterr


Posts: 5971
Posted: 05/18/2004, 10:48 AM

Kevin,

No, the above scenario cannot work because it is the first page that processes all the data, not the second page. When programming manually many people create a second page that reads the submitted data and processes it, however we do this in the 1st page. When designing a page in CCS, only that (1st) page knows how your form was designed and how to process its values. Therefore the page script is run twice - first to display the data, then to process it. The 2nd page is irrelevant in this case because it starts a completely new process.
It is the same as having 3 scripts: first to display the page, second to read submitted values and use them, 3rd to display another page. We just do both first 2 steps in one script therefore the "2nd page" is really the "1st page" and you can read the submitted values within that 1st page, for example in Before Insert event.

It seems though that you are expecting product support via user forums, which we do not provide. I am answering your question only in user capacity and if you need support please visit http://support.codecharge.com.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
klwillis


Posts: 428
Posted: 05/18/2004, 11:26 AM

So, it's not possible for a form record (on a first page) to pass
data onto a second page?

Suppose you had three data-forms, the first can be an HTML-based
form, but the 2nd and 3rd cannot.

Assuming you had only two data forms to work with, and
you needed to pass data from the first form to the 2nd,
how would you do it - step-by-step.

In the meantime, I'll contact technical support.

Quote peterr:
Kevin,

No, the above scenario cannot work because it is the first page that processes all the data, not the second page. When programming manually many people create a second page that reads the submitted data and processes it, however we do this in the 1st page. When designing a page in CCS, only that (1st) page knows how your form was designed and how to process its values. Therefore the page script is run twice - first to display the data, then to process it. The 2nd page is irrelevant in this case because it starts a completely new process.
It is the same as having 3 scripts: first to display the page, second to read submitted values and use them, 3rd to display another page. We just do both first 2 steps in one script therefore the "2nd page" is really the "1st page" and you can read the submitted values within that 1st page, for example in Before Insert event.

It seems though that you are expecting product support via user forums, which we do not provide. I am answering your question only in user capacity and if you need support please visit http://support.codecharge.com.

_________________
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
View profile  Send private message
peterr


Posts: 5971
Posted: 05/18/2004, 11:33 AM

One related example that we have is the "Multi-Step User Registration", also live at http://examples.codecharge.com/ExamplePack/MultiStepReg...gistration1.php
Once you fill out the 1st form, the program appends the "user_id" to the URL and then sends the user to the 2nd page using such URL. Therefore once on the 2nd page you will see a URL like "MultiStepRegistration2.php?user_id=3".
You could pass values in a similar way: use the "Retrieve Value" action in the After Insert and/or After Update event of your form on the 1st page, then append that value to the URL when redirecting to the 2nd page. I recommend that you review the custom code in "MultiStepRegistration1" page of that example.
Unfortunately it is probably not possible to POST values from one page to another and that's why the full URL needs to be used. The "POST" method that you probably referred to works only when the HTML Form is "posted" directly to the 2nd page, but in our case it is posted to the 1st page and then redirected to the 2nd.
Another way though would be to retrieve the values within the 1st page (in After Initialize, After Insert or After Update events) and save those values in session variables so that they are accessible on the 2nd page.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
klwillis


Posts: 428
Posted: 05/18/2004, 1:04 PM

It works! :-)

As I thought, it was a VERY simple solution ... I just over looked it.

Just had to set the action property for the HTML form.

Quote peterr:
One related example that we have is the "Multi-Step User Registration", also live at http://examples.codecharge.com/ExamplePack/MultiStepReg...gistration1.php
Once you fill out the 1st form, the program appends the "user_id" to the URL and then sends the user to the 2nd page using such URL. Therefore once on the 2nd page you will see a URL like "MultiStepRegistration2.php?user_id=3".
You could pass values in a similar way: use the "Retrieve Value" action in the After Insert and/or After Update event of your form on the 1st page, then append that value to the URL when redirecting to the 2nd page. I recommend that you review the custom code in "MultiStepRegistration1" page of that example.
Unfortunately it is probably not possible to POST values from one page to another and that's why the full URL needs to be used. The "POST" method that you probably referred to works only when the HTML Form is "posted" directly to the 2nd page, but in our case it is posted to the 1st page and then redirected to the 2nd.
Another way though would be to retrieve the values within the 1st page (in After Initialize, After Insert or After Update events) and save those values in session variables so that they are accessible on the 2nd page.
:-)
_________________
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
View profile  Send private message
peterr


Posts: 5971
Posted: 05/18/2004, 1:49 PM

Great. Just keep in mind that if you change the HTML to submit & post directly to the 2nd page then no field validation will be performed (in case you have required fields or want to verify field values otherwise). The validation would need to be done by the 1st page.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
klwillis


Posts: 428
Posted: 05/18/2004, 2:04 PM

You beat me to my next question. :-)

I'm trying to do a simple validation on
the text control field {YourName} on the
first form, just to make sure it's text length
is greater than zero.

However, when I submit the form, there
doesn't seem to be any field validation
done - it just submits the values to
the second form.

Any ideas why the validation isn't being done?


Quote peterr:
Great. Just keep in mind that if you change the HTML to submit & post directly to the 2nd page then no field validation will be performed (in case you have required fields or want to verify field values otherwise). The validation would need to be done by the 1st page.
:-)
_________________
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
View profile  Send private message
peterr


Posts: 5971
Posted: 05/18/2004, 2:12 PM

There are 2 types of validations: server and client.

The server validation is done within the first page and that's why by default the form should be submitted to the 1st page. One reason for this is that if the validation fails then the page needs to be re-displayed by the same script.
Actually, if your first page/form is supposed to store some values in the database then you also would need to have the Form Action set to the 1st page so that the same program can update the database.

If you still want to POST the form directly to the 2nd page then you could use the client validation, which could be implemented by yourself directly within the HTML by adding some JavaScript. You could probably find some examples here http://www.google.com/search?q=javascript+validate+minimum+field+length
_________________
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.

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.