Query String Input Autofiller

By Aditya Mukherjee Last update Sep 8, 2008 — Installed 114 times.
Script Summary:
Automatically fill input boxes using query strings in your URL.

Script homepage

Recently Updated TopicsPosts
Archived Comments4

this script has 1 topic, 4 posts

This script has no reviews.

Use query strings in your URL to automatically fill text boxes (INPUT/TEXTAREA). The 'key' is the ID of the text box, and the 'value' is the content to fill it with. So if there is a input#url on your target page, and you want to pre-fill it with 'http://google.com', you would use this URL:

http://url.totargetpage.com?url=http://google.com

If the script cannot find an element with a matching ID (it does three checks: normal case, uppercase, lowercase), it just skips that key. This should not interfere with most internal scripts on pages meant to do the same thing, because it fires on completion of the page load.

Some pages however use a server side $_REQUEST type catch, which this might interfere with, so use it sparingly in those cases.

A good place to try it would be: http://is.gd?url=http://downforeveryoneorjustme... (after installing the script)

The script also features (a toggle-able) feature which adds the ID of text boxes (INPUT/TEXTAREA) as a hover tip (if available) so that it's easy to know what 'key' value to use in your URL.

Update (8th September)

* Fixed for TEXTAREA (innerHTML and not value)

Update (10th July)

* Added check for type='hidden' before auto-filling. Doesn't auto-fill on hit

Bugfix (5th July)

* Forgot to add statement to populate the textbox on a successful #ID match

Update (3rd July)

* Script now falls back to check name attribute for a key match in case it cannot find a text box with the specified ID. This increases scope to many more elements, so be careful (thanks Steve)

Update (2nd July)

* Added a decodeURIComponent(value) to negate automatic escaping of value when used with Firefox's bookmark keyword feature. Plus, it just makes good sense.

* Added a toggle variable to turn input box ID display on or off.