CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> PHP

 Auto fill based on two fields

Print topic Send  topic

Author Message
rla

Posts: 18
Posted: 11/22/2013, 10:11 AM

Hi,

I want to autofill based on two fields - I been able to do it on based on one field, but I am trying to figure out how to change it for two field to autofill. The two fields narrow it down in the table to the proper values.

I been looking at the service and see the data source select using the {keyword} as how its passing the one variable. Has anyone be able to modify the auto fill to make the selection based on two or more values.

Thanks
View profile  Send private message
eratech


Posts: 513
Posted: 11/25/2013, 1:55 AM

Ria - You can't do it without editing the page & service

Have a look at the javascript in the page that does the request to the service - it passes the querystring parameter 'keyword', so you can edit it to add a 'keyword2' and get the value for that.

Then add the keyword2 to the server data:
WHERE name1 = '{keyword}' AND name2='{keyword2}'

Another way of searching (depending a lot on your data) is to concatenate the 2 values into a single {keyword} then do the search with the concatenated fields.

eg if you have a zip/postal code (simple, fixed data) and some more flexible data (townname/suburb) and you needed to look up a mail centre ID (or something unique)

{keyword} = 90210:Beverly Hills

Service SQL datasource :
WHERE concat(postcode,':'towname) like '{keyword}%'

Not terribly useful, but I've done it a couple of times.

E
_________________
CCS 3/4/5 ASP Classic, VB.NET, PHP
Melbourne, Victoria, Australia
View profile  Send private message
rla

Posts: 18
Posted: 11/25/2013, 1:35 PM

Thanks - I ended up going the simpler but uglier way of combining the fields in a view and concat the variables into a separate field which works fine.

I did try the other way first - added keyword2 to the service but I was not able to figure out how to pass the parameter in - looks like it may require modifying cs-auto-fill.js common file in addition to the html code.

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.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.