CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> Archive -> GotoCode Archive

 Optimized parameter passing

Print topic Send  topic

Author Message
Brent
Posted: 02/12/2002, 7:16 AM

There may be a way to reduce the clutter in the URL when passing parameters.
If I have a Search form with 10 fields in it, and the user searches with only
one of the fields, the URL fills up with 10 fields, 9 of them are empty.
My question is why bother to pass the empty fields?

Why pass parameters if they are set to an empty value? If the receiving
form does a get_param(), then it is the same as if the field is not there.
So why clutter up the URL with unecessary fields?
Andrew B
Posted: 02/13/2002, 8:02 PM

That is just the way forms work. If you make any form and 'submit' it, it will pass *all* the variables regardless of empty/full. There may be a fancy way around this, such as removing form elements in JS, but it certainly isn't worth the hastle.

If you think cc is messy, go check out msdn.microsoft.com and do a search. Every single check box on the form (and there are a LOT) is passed. The url goes on for miles.
Brent
Posted: 02/14/2002, 9:50 PM

>>That is just the way forms work. If you make any form and 'submit' it, it will pass *all* the
>>variables regardless of empty/full.

I guess I need to ask, "But Why?". If I have a search form with 20 fields on it,
why should it generate a URL with 20 empty search fields? It is just inefficient and
I don't see why CC should throw a lot of junk in the URL when it doesn't need to.

If no one can see a purpose for these empty url fields, I'll submit it on my wish list and see what happens.

You see, I have to debug the URL, and following 200+ characters of useless text is a pain.
Getting rid of the redundant parameters will simplify things.
Jenny Horn
Posted: 11/20/2003, 1:51 AM

I have worked with HTML forms for years and I'm afraid this is not something that CodeCharge is doing. It is the nature of HTML forms to work this way. The HTML specification homepage is at http://www.w3c.org/MarkUp/ and this may help you understand how the browser handles what it is given.

   


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.