•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 430,001 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,505 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 1233 | Replies: 8
![]() |
I did a search as I had hoped this has been dealt with by someone before me.
I'm trying to take a search form on a website and ONLY pass fields or values for fields that are actually selected or used.
What I mean is this. The search form has 16 fields and regardless of how many fields the user actually uses, the string or "GET" url includes ALL fields. I'd like to make several fields excluded unless a user has selected that criteria.
When a person searches for just MLS # for instance, things like Square Foot, Price, City, Zip, and all other fields are pointless to process which causes substantial burden on the system because there are 57,000 listings.
JavaScript will work, my question is are there examples anywhere?
I'm trying to take a search form on a website and ONLY pass fields or values for fields that are actually selected or used.
What I mean is this. The search form has 16 fields and regardless of how many fields the user actually uses, the string or "GET" url includes ALL fields. I'd like to make several fields excluded unless a user has selected that criteria.
When a person searches for just MLS # for instance, things like Square Foot, Price, City, Zip, and all other fields are pointless to process which causes substantial burden on the system because there are 57,000 listings.
JavaScript will work, my question is are there examples anywhere?
The only way to exclude fields from being passed with the querystring is to mark them as disabled. Disabled form data is not submitted. How to achieve this would be your call.
You can on form submit call a function which would disable all the fields whose trimmed value is a blank string.
You can on form submit call a function which would disable all the fields whose trimmed value is a blank string.
I don't accept change. I don't deserve to live.
Happiness corrupts people.
Failing to value the lives of others cheapens your own.
Happiness corrupts people.
Failing to value the lives of others cheapens your own.
I do have it working but there is a strange issue with FireFox. You can see the example and the code here. http://www.elpasohomepage.com/listings/hidefields.html
If you select for instance ONLY price range and leave all others untouched you will notice it passes only fields with values. I believe I have image only set as a default so that will always pass on this search.
Does anyone have any idea why the code acts the way it does in FireFox?
~ Jared
If you select for instance ONLY price range and leave all others untouched you will notice it passes only fields with values. I believe I have image only set as a default so that will always pass on this search.
Does anyone have any idea why the code acts the way it does in FireFox?
~ Jared
•
•
Join Date: Dec 2004
Location: London or Slovakia
Posts: 2,476
Reputation:
Rep Power: 11
Solved Threads: 298
Can you describe the issu or make screenshot of it because I tried various things and always got results. Or you solved that problem?
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
If we helped you to solve your problem, answered your question please mark your post as SOLVED.
Publilius Syrus
(~100 BC)
If we helped you to solve your problem, answered your question please mark your post as SOLVED.
Yes the issue is this, when I submit the form once it works fine, but when I go back to the form in FireFox it leaves the text fields inactive so I could not add a value to them if I wanted to.
The only reason I wanted to bother with this is the size of the search form I did during the integration of the new redesign of Condolux. You can see the form there at http://www.condolux.net/myrtle-beach-listings/ That site (joomla, wordpress openrealty) works fine except when we have a spank of traffic it can literally crawl and its because of the size of the search forms. There is no need to query fields with "NULL" values so we use this script but it is causing me a headache in FireFox.
Any help is greatly appreciated.
~ Jared
The only reason I wanted to bother with this is the size of the search form I did during the integration of the new redesign of Condolux. You can see the form there at http://www.condolux.net/myrtle-beach-listings/ That site (joomla, wordpress openrealty) works fine except when we have a spank of traffic it can literally crawl and its because of the size of the search forms. There is no need to query fields with "NULL" values so we use this script but it is causing me a headache in FireFox.
Any help is greatly appreciated.
~ Jared
•
•
Join Date: Jun 2008
Location: Phoenix, AZ
Posts: 812
Reputation:
Rep Power: 2
Solved Threads: 64
Yeah I'm not sure but I tried the following with no success.
<script type="text/javascript">
function noBack(){window.history.forward();}
</script>
<body onload="noBack();" onpageshow="if(event.persisted)noBack();" onunload="">
And I tried
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
I'm not sure its a caching issue but I'll keep looking.
<script type="text/javascript">
function noBack(){window.history.forward();}
</script>
<body onload="noBack();" onpageshow="if(event.persisted)noBack();" onunload="">
And I tried
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
I'm not sure its a caching issue but I'll keep looking.
![]() |
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- Firefox Compatibility help with script (JavaScript / DHTML / AJAX)
- dynamic html (PHP)
- how to get to next record on click of a button. (JavaScript / DHTML / AJAX)
- problem in javascript coding in asp page (ASP)
- Submit Button Help (JavaScript / DHTML / AJAX)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Javascript iFrame problem (having a brain fart)
- Next Thread: Issue with IE on JS Gallery



Linear Mode