current url in form

  • Thread starter Thread starter Don Kuykendall
  • Start date Start date
D

Don Kuykendall

I have a form that I would like the current url used to fill in one
box. I have a piece of software that generates a unique number for the
computer and I use that number to generate a key to unlock software.
It generates the number and adds it ot he end of the url.
www.mysite.com/keycode.htm?1234-5678 I would like this code to be in a
form to be mailed back to me along with other info that they would
fill out.
 
In html view in the form before the field

--



| This is exactly what I want to do but I can not figure out where to
| put the script. Do I put it in the head, body or in the form.
| Everywhere I try the script shows up in the place and it does not
| work.
|
| I appreciate your help in this matter. I am much more comfortable in
| MS Access.
|
|
| >>
| > <script>
| > document.forms(0).T1.value = document.location;
| > </script>
| >
| > The following code would prefill a text box named T1 with
| > whatever follows a ? in the url of the current page:
| >
| > <script>
| > if (document.location.search.length > 0) {
| > document.forms[0].T1.value =
| > document.location.search.substring(1,
| > document.location.search.length);
| > }else{
| > document.forms[0].T1.value = "";
| > }
| > </script>
| >
| > Jim Buyens
| > Microsoft FrontPage MVP
| > (e-mail address removed)
| > http://www.interlacken.com
| > Author of:
| > *------------------------------------------------------*
| > |\----------------------------------------------------/|
| > || Microsoft Office FrontPage 2003 Inside Out ||
| > || Microsoft FrontPage Version 2002 Inside Out ||
| > || Web Database Development Step by Step .NET Edition ||
| > || Troubleshooting Microsoft FrontPage 2002 ||
| > || Faster Smarter Beginning Programming ||
| > || (All from Microsoft Press) ||
| > |/----------------------------------------------------\|
| > *------------------------------------------------------*
 
OK I think I have it in the correct location but somehow it still does
not work. I must be missing something somewhere. Here is a test
version of the form
http://www.tracsoftdesign.net/blrsafetytrac/key_request.htm?1234-5678
that may help in being able to find out what I am doing wrong.

Here's the URL of a working example:

http://www.interlacken.com/examples/qstring.htm?Working

Jim Buyens
Microsoft FrontPage MVP
(e-mail address removed)
http://www.interlacken.com
Author of:
*------------------------------------------------------*
|\----------------------------------------------------/|
|| Microsoft Office FrontPage 2003 Inside Out ||
|| Microsoft FrontPage Version 2002 Inside Out ||
|| Web Database Development Step by Step .NET Edition ||
|| Troubleshooting Microsoft FrontPage 2002 ||
|| Faster Smarter Beginning Programming ||
|| (All from Microsoft Press) ||
|/----------------------------------------------------\|
*------------------------------------------------------*
 
Back
Top