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

 EASY Q: How to submit record form textbox value as parameter?

Print topic Send  topic

Author Message
VBAjedi


Posts: 34
Posted: 03/24/2004, 4:50 PM

I have a page with the usual grid/record forms combo as generated by the Grid and Record Builder.

How do I attach the value from one of the Record form's controls (a listbox named V_TransDist) to the URL as a parameter with the same name as the control? (Just like what happens on a Search form). Is there a simple design-view option that will do this, or do I have to use custom code in an event?

I need to make that value accessible to a child grid that appears later on the same page.

Thanks!
_________________
VBAjedi
jedi at NOSPAM dot obie dot com
View profile  Send private message
peterr


Posts: 5971
Posted: 03/25/2004, 7:38 PM

I think that it is not necessary to convert this value to a URL if all you want is to use this value in a child grid.
You should only specify in the child grid's "Data Source" that you want to access "Form" type parameter instead of "URL" type.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
VBAjedi


Posts: 34
Posted: 03/26/2004, 10:46 AM

Thanks for your reply, Peter!

Ok, you make that sound easy, but I've been poking around in menus for over an hour now and can't seem to find/get that working. I think I need specific step-by-step instructions.

The value I'm after is on a Record form named vehkeyedit in a listbox named V_TransDist . Later on the same page I have an Editable Grid form named spacekey with a hidden field named TransDistMaster in the title section (by the FormState hidden control). Specifically how do I get the value from V_TransDist to appear in TransDistMaster?

I tried going into the Data Source window for spacekey (which is set to the default Table data source type), but the only place I can find the option to add a "Form" type parameter is in the sub-window for editing individual "where" conditions, and I don't think that's what you are talking about. I tried changing the Data Source Type to SQL and adding a Form Parameter to get the value, but it didn't get the value AND the spacekey editable grid generated warnings when I published it that I will have to set up custom add/update/delete operations.

Please help!
_________________
VBAjedi
jedi at NOSPAM dot obie dot com
View profile  Send private message
peterr


Posts: 5971
Posted: 03/26/2004, 12:53 PM

Yep, the place I had in mind was the sub-window for editing individual "where" conditions.
This should work with both the Table and SQL Data Sources.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
peterr


Posts: 5971
Posted: 03/26/2004, 1:11 PM

BTW, let me just explain that the form can submit information as either GET/URL or POST/FORM variables. Usually the record forms POST the data. Your Grid should be able to retrieve either of the value types, URL or FORM. Please try it and let me know if this finally works for you.
Also, are both the Grid and Record forms on the same page?
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
VBAjedi


Posts: 34
Posted: 03/26/2004, 1:24 PM

Yes, both the grid and record forms are on the same page. And they draw from different tables. Currently the record form is not submitting any Get/URL variables because I haven't figured out how to do that (grr!). It does update the database correctly, though.

The page is loosely based on the Example Pack "Order entry" example, where you first choose a customer, create/select an order for them, then add/edit items to the order. Only for a different application.


_________________
VBAjedi
jedi at NOSPAM dot obie dot com
View profile  Send private message
peterr


Posts: 5971
Posted: 03/26/2004, 1:32 PM

OK. Then please try using the FORM type instead of URL in the Grid's Where Parameters.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
VBAjedi


Posts: 34
Posted: 03/26/2004, 1:37 PM

Ok, a possible source of confusion just occurred to me. I'm trying to use the value from the record form to "pre-populate" a field for NEW records in the editable grid (not to use as a query criteria for existing records). The problem I'm having is related to what happens when a new record is entered into the record form. When it's submitted, the editable grid appears allowing you to enter child records (like items for an order). Each child record needs to have two values from the record form (like customer name and order ID), but I don't want my users to have to type them again for each line. So I want them to be pre-populated based on the values in the record form.

If I could figure out how to submit the value from V_TransDist (on the record form) as a GET variable, that might work too. . . I know how to fill a control from a value in the URL.
_________________
VBAjedi
jedi at NOSPAM dot obie dot com
View profile  Send private message
peterr


Posts: 5971
Posted: 03/26/2004, 1:51 PM

Converting POST/FORM parameter to URL may not be efficient, and I'm not sure offhand how to do this.
But if you know how to retrieve the URL value than retrieving the POST/FORM value should be almost the same.
You could use the action "Retrieve Value for Control" in the field's Before Show event. Or use the CCGetFromPost function.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
VBAjedi


Posts: 34
Posted: 03/26/2004, 2:19 PM

Are you saying that when I click "Add" or "Submit" on a record form, the value from each control on that form is automatically submitted as a POST variable (bearing the name of the control the value came from)?

I tried your suggestion of adding a "Retrieve Value For Control" action to the fields Before Show event. I set the control name to TransDistMaster, the source type to Form, and the Source Name to V_TransDist , but the field is blank when the page loads. . .

This CAN'T be that difficult!
_________________
VBAjedi
jedi at NOSPAM dot obie dot com
View profile  Send private message
peterr


Posts: 5971
Posted: 03/26/2004, 2:51 PM

Sorry, at first I didn't know what you're doing with the grid of it was an editable grid. Now that it is clear, there could be several approaches.
Maybe try putting in the Default property the function CCGetFromGet("V_TransDist", "")
This worked for me in ASP but could be a bit different in PHP.
Otherwise you can contact our support and let them check this out.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
peterr


Posts: 5971
Posted: 03/26/2004, 2:57 PM

BTW, you could also try changing POST to GET in the HTML, so that the record form is submitted directly via GET/URL.
_________________
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.