473,473 Members | 2,222 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Javascript to modify query string of request

Searching through google groups, I have not found anyone able to modify
the query string of a request. I was hoping to make the query string
as short as possible so that a search with many criteria could be
bookmarked. I had planned to have the query string be
key=value for each criteria
But with dropdowns, the default choice is always submitted. There
were other parameters that I had to use that were longer than I hoped.
And checkboxes are actually value=on. Is there anyway to modify the
query string before the form is submitted?

One possibility that I thought of was to have a hidden field in one
form and have javascript to populate the hidden field from the form
that shows. You could submit the form with the hidden field.
Is there any easier way?

Jul 23 '05 #1
1 7115

Glenn wrote:
Searching through google groups, I have not found anyone able to modify the query string of a request. I was hoping to make the query string
as short as possible so that a search with many criteria could be
bookmarked. I had planned to have the query string be
key=value for each criteria
But with dropdowns, the default choice is always submitted. There
were other parameters that I had to use that were longer than I hoped. And checkboxes are actually value=on. Is there anyway to modify the
query string before the form is submitted?

One possibility that I thought of was to have a hidden field in one
form and have javascript to populate the hidden field from the form
that shows. You could submit the form with the hidden field.
Is there any easier way?


that comes to my mind (though i never tried it)

1. prevent the submission of the form with some eventhandler
2. have javascript read the values of the form fields
3. build your custom query string
4. window.location.href = 'somefile.htm?' + your_query_string;

if your query string has the format of

?name=value&name2=value2...
it can be used like data from a form sent with method=get

micha

Jul 23 '05 #2

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

Similar topics

0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.