User Name Password Register
DaniWeb IT Discussion Community
All
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
Reply
Join Date: Feb 2005
Location: USA
Posts: 60
Reputation: php4ever is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
php4ever's Avatar
php4ever php4ever is offline Offline
Junior Poster in Training

Active Form Fields JavaScript

  #1  
May 29th, 2008
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?
Dont hate me because I'm beautiful.....
Where I Work
Where I Rant :: Where Beauty Meets The Web
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jun 2006
Location: India
Posts: 6,871
Reputation: ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold 
Rep Power: 23
Solved Threads: 345
Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Lazy, Useless & Apathetic

Re: Active Form Fields JavaScript

  #2  
May 31st, 2008
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.
I don't accept change. I don't deserve to live.

Happiness corrupts people.

Failing to value the lives of others cheapens your own.
Reply With Quote  
Join Date: Feb 2005
Location: USA
Posts: 60
Reputation: php4ever is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
php4ever's Avatar
php4ever php4ever is offline Offline
Junior Poster in Training

Re: Active Form Fields JavaScript

  #3  
May 31st, 2008
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
Dont hate me because I'm beautiful.....
Where I Work
Where I Rant :: Where Beauty Meets The Web
Reply With Quote  
Join Date: Dec 2004
Location: London or Slovakia
Posts: 2,476
Reputation: peter_budo is a jewel in the rough peter_budo is a jewel in the rough peter_budo is a jewel in the rough peter_budo is a jewel in the rough 
Rep Power: 11
Solved Threads: 298
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: Active Form Fields JavaScript

  #4  
Jun 1st, 2008
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.
Reply With Quote  
Join Date: Feb 2005
Location: USA
Posts: 60
Reputation: php4ever is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
php4ever's Avatar
php4ever php4ever is offline Offline
Junior Poster in Training

Re: Active Form Fields JavaScript

  #5  
Jun 1st, 2008
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
Dont hate me because I'm beautiful.....
Where I Work
Where I Rant :: Where Beauty Meets The Web
Reply With Quote  
Join Date: Feb 2005
Location: USA
Posts: 60
Reputation: php4ever is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
php4ever's Avatar
php4ever php4ever is offline Offline
Junior Poster in Training

Re: Active Form Fields JavaScript

  #6  
Jun 25th, 2008
*bump back to attention*
Dont hate me because I'm beautiful.....
Where I Work
Where I Rant :: Where Beauty Meets The Web
Reply With Quote  
Join Date: Jun 2008
Location: Phoenix, AZ
Posts: 812
Reputation: R0bb0b is on a distinguished road 
Rep Power: 2
Solved Threads: 64
R0bb0b's Avatar
R0bb0b R0bb0b is offline Offline
Practically a Posting Shark

Re: Active Form Fields JavaScript

  #7  
Jun 25th, 2008
you may need to trigger an onload event to reverse them.
Reply With Quote  
Join Date: Feb 2005
Location: USA
Posts: 60
Reputation: php4ever is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 0
php4ever's Avatar
php4ever php4ever is offline Offline
Junior Poster in Training

Re: Active Form Fields JavaScript

  #8  
Jun 26th, 2008
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.
Dont hate me because I'm beautiful.....
Where I Work
Where I Rant :: Where Beauty Meets The Web
Reply With Quote  
Join Date: Jun 2008
Location: Phoenix, AZ
Posts: 812
Reputation: R0bb0b is on a distinguished road 
Rep Power: 2
Solved Threads: 64
R0bb0b's Avatar
R0bb0b R0bb0b is offline Offline
Practically a Posting Shark

Re: Active Form Fields JavaScript

  #9  
Jun 26th, 2008
I actually had in mind a function that, every time the user goes to that page, will loop through all of the form elements and if disabled will enable them.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JavaScript / DHTML / AJAX Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 12:59 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC