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 -> ASP

 default value for a listbox selection

Print topic Send  topic

Author Message
netsys

Posts: 39
Posted: 09/05/2013, 12:33 PM

I've got a listbox on an editable grid that I want to show only certain items, based on a URL parameter. It's working fine with a where parameter in the listbox data source, but if I use this:
 <option value="">Select A Value</option>
, Select A Value is always shown as the default choice in the listbox, even after narrowing the data down using the URL parameter. The correct data is present in the listbox, but the Select A Value default is always there.

This is most likely very simple. Does anyone know what's wrong here?

Thanks.
View profile  Send private message
netsys

Posts: 39
Posted: 09/09/2013, 12:05 PM

I did finally find the problem - if you want the listbox to get its value from the URL parameter, the name of the listbox needs to be the same as the URL parameter. In the example shown here: http://support.yessoftware.com/kb_article.asp?article_id=61, the listbox would be named state_id. It was indeed a simple solution.
View profile  Send private message
eratech


Posts: 513
Posted: 10/28/2013, 10:27 PM

Good work.

You can also set the values even if the listbox (or text box etc) isn't the same as the parameter, by using the 'Before Show' event of the listbox, and setting the Source to 'URL' and the name to the querystring parameter.

e
_________________
CCS 3/4/5 ASP Classic, VB.NET, PHP
Melbourne, Victoria, Australia
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.