473,326 Members | 2,110 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Bypassing blamk fields

I have one form, many text input types which allow users to to do a search
of my image database. It is possible, with this form to leave certain text
fields blank.
Is there a way to use javascipt to bypass blank fields in a search? I dont
want to take up processor time or see the blank name/value pairs in the
query string. Anyone know what i mean?
Jul 23 '05 #1
1 1078
Ron
Kelley Perry wrote:
I have one form, many text input types which allow users to to do a search
of my image database. It is possible, with this form to leave certain text
fields blank.
Is there a way to use javascipt to bypass blank fields in a search? I dont
want to take up processor time or see the blank name/value pairs in the
query string. Anyone know what i mean?

Just use a conditional. If the javascript is generating an URL query
string by looping through inputs, it may look something like this:

var myURL = "http://www.mywebsite.com/myformhandler.php?";
var myInputs =
document.getElementById("myForm").getElementsByTag Name("input");
for(i=0;i<myInputs.length;i++) {
myURL += (myInputs[i].value=="") ? "" : myInputs[i].name + "=" +
myInputs[i].value + "&";
}
myURL = encodeURI(myURL);
window.location.href = myURL;
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jens Kalkbrenner | last post by:
MS SQL-Server 7.0 Bypassing recovery for database 'EfW_765' because it is marked IN LOAD. What does this mean? Our customer is backing up is maindatabase and is recovering it to this database for...
0
by: cgian31 | last post by:
I need to hide the complexity from users to access an information webpage, which is normally accessible after filling in a web form with the correct data. The address of the information webpage...
4
by: cgian31 | last post by:
I need to hide the complexity from users to access an information webpage, which is normally accessible after filling in a web form with the correct data. The address of the information webpage...
3
by: Eric St-Onge | last post by:
Hi, I have a DLL that exposes COM interfaces. One of the COM Object receives an IDispatch pointer. I know that this IDispatch pointer is in fact a COM Callable Wrapper for a...
4
by: antonyliu2002 | last post by:
Let me try to make clear what my concern is. I think it is a pretty interesting one, which I think of while I am developing my web application. I have an authenticated/authorized web...
0
by: John Smith | last post by:
Hello, I am developing a VB.NET 2003 application that will use lots of Crystal Reports. Sometimes the users will preview a report in a Crystal report viewer, and sometimes they will send the...
1
by: =?Utf-8?B?QXVzdGluIFN0ZXBoZW5z?= | last post by:
In my commercial financial application I run a deposit report. I use an option to copy the report to the Clipboard. I then run a .NET consol app to “grab” the Clipboard and format the data...
10
by: Tim Streater | last post by:
I have a form and a button to submit it. The button is made from: <input type=button onclick='myHandler(this.form);'> This all works fine except that in Safari 2.0.4, the enter/return keys, if...
4
Chrisjc
by: Chrisjc | last post by:
The question at hand is I bypass an array in column 4... but I also have something else that should be going in there from the database but because I am bypassing it and forcing it to show the ony...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, youll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shllpp 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.