creating a link to a form

  • Thread starter Thread starter Mike Macgowan
  • Start date Start date
M

Mike Macgowan

Hi all,

I would like to create a link on my page that sends a zip code and radius to
the following form:

<form method="POST" action="http://zipfind.net/scripts/miles.exe">
</TD>
<TD>
<FONT FACE="MS Sans Serif, Arial, Helvetica" SIZE="1"><B>ZIP
Code:</B></font><BR>
<INPUT Class="Text" NAME="102" VALUE="" TYPE="TEXT" SIZE="7"
MAXLENGTH="5">
</td>
<TD>
<FONT FACE="MS Sans Serif, Arial, Helvetica"
SIZE="1"><B>Radius:</B></font><BR>
<INPUT TYPE="text" NAME="103" VALUE="" SIZE="3" MAXLENGTH="3"
CLASS="Text">
</TD> <td>
<INPUT NAME="1002" TYPE="SUBMIT" VALUE="Find Zip Codes"
Class="Submit">
</td>
<TD></form>

I tried http://http://zipfind.net/scripts/miles.exe?102=80241&103=5 to
submit a zip of 80241 and a radius of 5, but it does not return a valid
page. Can anyone decipher what I am doing wrong?

Thanks in advance,

hyperless in denver
 
Thanks Jim.

I don't have the option of changing the form as I am passing the data to the
form. I was hoping I could get the data put together so that the form would
accept it. I have inquired into the site about customizing the database. I
appreciagte your help and anyone else that may have additiional ideas.


Jim Buyens said:
If you can make this an ASP page, code your two <input>
tags:

<INPUT Class="Text" NAME="102"
VALUE="<%=request("102")%>" TYPE="TEXT" SIZE="7"
MAXLENGTH="5">

and

<INPUT TYPE="text" NAME="103"
VALUE="<%=request("102")%>" SIZE="3"
MAXLENGTH="3" CLASS="Text">

If you can't use ASP, add this code to the <head> section
of your page.

<script>
function qsobj (){
var qvbl;
var qstring = "" + document.location.search.substring(1);
if (qstring != ""){
var qpairs = qstring.split("&");
for (i=0; i < qpairs.length; i++) {
qvbl = qpairs.split("=");
this["" + qvbl[0]] =
unescape(qvbl[1].replace("+"," "));
}
}
}
function getQS(avbl){
if (qstr[avbl] == null){
return "";
}else{
return qstr[avbl];
}
}
var qstr = new qsobj();
</script>

and then code your form fields like this:

<script>
document.write("<INPUT Class='Text' NAME='102' VALUE='" +
getQS("102") +
"' TYPE='TEXT' SIZE='7' MAXLENGTH='5'>");
</script>

and

<script>
document.write("<INPUT Class='Text' NAME='103' VALUE='" +
getQS("103") +
"' TYPE='TEXT' SIZE='3' MAXLENGTH='3'>");
</script>

Jim Buyens
Microsoft FrontPage MVP
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) ||
|/----------------------------------------------------\|
*------------------------------------------------------*



-----Original Message-----
Hi all,

I would like to create a link on my page that sends a zip code and radius to
the following form:

<form method="POST" action="http://zipfind.net/scripts/miles.exe">
</TD>
<TD>
<FONT FACE="MS Sans Serif, Arial, Helvetica"
SIZE="1"> said:
Code:</B></font><BR>
<INPUT Class="Text" NAME="102" VALUE="" TYPE="TEXT" SIZE="7"
MAXLENGTH="5">
</td>
<TD>
<FONT FACE="MS Sans Serif, Arial, Helvetica"
SIZE="1"><B>Radius:</B></font><BR>
<INPUT TYPE="text" NAME="103" VALUE="" SIZE="3" MAXLENGTH="3"
CLASS="Text">
</TD> <td>
<INPUT NAME="1002" TYPE="SUBMIT" VALUE="Find Zip Codes"
Class="Submit">
</td>
<TD></form>

I tried http://http://zipfind.net/scripts/miles.exe? 102=80241&103=5 to
submit a zip of 80241 and a radius of 5, but it does not return a valid
page. Can anyone decipher what I am doing wrong?

Thanks in advance,

hyperless in denver


.
 
If you can make this an ASP page, code your two <input>
tags:

<INPUT Class="Text" NAME="102"
VALUE="<%=request("102")%>" TYPE="TEXT" SIZE="7"
MAXLENGTH="5">

and

<INPUT TYPE="text" NAME="103"
VALUE="<%=request("102")%>" SIZE="3"
MAXLENGTH="3" CLASS="Text">

If you can't use ASP, add this code to the <head> section
of your page.

<script>
function qsobj (){
var qvbl;
var qstring = "" + document.location.search.substring(1);
if (qstring != ""){
var qpairs = qstring.split("&");
for (i=0; i < qpairs.length; i++) {
qvbl = qpairs.split("=");
this["" + qvbl[0]] =
unescape(qvbl[1].replace("+"," "));
}
}
}
function getQS(avbl){
if (qstr[avbl] == null){
return "";
}else{
return qstr[avbl];
}
}
var qstr = new qsobj();
</script>

and then code your form fields like this:

<script>
document.write("<INPUT Class='Text' NAME='102' VALUE='" +
getQS("102") +
"' TYPE='TEXT' SIZE='7' MAXLENGTH='5'>");
</script>

and

<script>
document.write("<INPUT Class='Text' NAME='103' VALUE='" +
getQS("103") +
"' TYPE='TEXT' SIZE='3' MAXLENGTH='3'>");
</script>

Jim Buyens
Microsoft FrontPage MVP
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) ||
|/----------------------------------------------------\|
*------------------------------------------------------*
 
Mike Macgowan said:
Thanks Jim.

I don't have the option of changing the form as I am passing the data to the
form. I was hoping I could get the data put together so that the form would
accept it. I have inquired into the site about customizing the database. I
appreciagte your help and anyone else that may have additiional ideas.

Have you considered bypassing the supplied form, and developing your
own form using the same form field names and action property?

Or perhaps you could open the existing form in a frameset or a new,
named window, and then manipulate its properties from your page.

Jim Buyens
Microsoft FrontPage MVP
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) ||
|/----------------------------------------------------\|
*------------------------------------------------------*
 
Thanks for your ideas. I took what you said earlier and found a database
using ASP. I create the hyperlinks in mappoint, seed them with the zip and
specify the radius and a beautiful table pops up with a lot of extra
statistics that makes us look like we spent years programming. Your bits
were essential.
 
Back
Top