Welcome to Dream.In.Code
Getting Help is Easy!

Join 132,299 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,034 people online right now. Registration is fast and FREE... Join Now!




Capture URL parameters in a form page

 
Reply to this topicStart new topic

Capture URL parameters in a form page, Getting one pages parameters into another pages text box.

TTope
post 2 Oct, 2008 - 09:04 AM
Post #1


New D.I.C Head

*
Joined: 2 Oct, 2008
Posts: 1

I have a page http://www.anywhere.com/contact.htm?locid=...scription=front

I would like to capture the parameters and add each to its own hidden textbox.

CODE

<head>

<meta http-equiv="Content-Language" content="en-us"/>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/>

<title>Contact Information</title>

<script type="text/javascript">
var qsParm = new Array();
function qs() {
var query = window.location.search.substring(1);
var parms = query.split('&');
for (var i=0; i<parms.length; i++) {
var pos = parms[i].indexOf('=');
if (pos > 0) {
var key = parms[i].substring(0,pos);
var val = parms[i].substring(pos+1);
qsParm[key] = val;
}
}
}
qsParm['locid'] = null;
qsParm['unitid'] = null;
qsParm['description'] = null;
qs();
</script>
</head>

<body>

<form title="contact" method="POST" action="contacthandler.asp" target="_parent" xml:lang="en-us">

    <table border="1" width="100%" style="border-top-style: none; border-right-style: none; border-left-style: none; border-bottom-style: none">
    <tr>
    <td align="right" style="width: 209px; border-top-style: none; border-right-style: none; border-left-style: none; height: 28px; border-bottom-style: none; text-align: center;"><input type="hidden" name="locid" style="width: 95px" /></td>
    <td align="left" style="width: 77px; border-top-style: none; border-right-style: none; border-left-style: none; border-bottom-style: none; text-align: center;"><input type="hidden" name="description" style="width: 95px"/></td>
    <td align="left" style="width: 162px; border-top-style: none; border-right-style: none; border-left-style: none; border-bottom-style: none; text-align: center;"><input type="hidden" name="unitid"  style="width: 95px"/></td>
    </tr>
    </table>

</form>

</body>

</html>
User is offlineProfile CardPM

Go to the top of the page

gabehabe
post 2 Oct, 2008 - 10:08 AM
Post #2


Working Girl.

Group Icon
Joined: 6 Feb, 2008
Posts: 5,402



Thanked 94 times

Dream Kudos: 2625

Expert In: Dingleberries

My Contributions


Moved to JavaScript. smile.gif
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/22/08 01:40AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month