I have a form that I want to kick-off a .js file. I can get the form to kick-off a function withhin the .html, but I need it to be integrated into a "already written" .js file. Basically what I want this to do is give a user two options -
1. Either lookup weather by zip, in which I splice in the form input value to a pre-defined http: address or
2. Select pre-defined weather locations. But not both.
Here is the FORM:
<form name="zipsearch" method="post" action="" enctype="multipart/form-data">
<font color="#000000">Enter Zip Code</font>
<input name="findzip" maxlength="5" size="5" TYPE="text">
<input type="button" value="GO"
onClick="GO()">
</form>
Here is the GO function:
function GO()
{
var zipcodepars = document.zipsearch.findzip.value;
{
document.weathermagnet.src='// alert("You Chose " + zipcodepars)
// document.write(zipcodepars)
// document.write("<a name=weathermagnetlink
this is the trouble area - using the zipcodepars variable in a pre-defined http: address
}
}
What I want to do is use the zip code and parse that zipcode into the http address, accept I need it to do this in the .js file within the GO function.
1. Either lookup weather by zip, in which I splice in the form input value to a pre-defined http: address or
2. Select pre-defined weather locations. But not both.
Here is the FORM:
<form name="zipsearch" method="post" action="" enctype="multipart/form-data">
<font color="#000000">Enter Zip Code</font>
<input name="findzip" maxlength="5" size="5" TYPE="text">
<input type="button" value="GO"
onClick="GO()">
</form>
Here is the GO function:
function GO()
{
var zipcodepars = document.zipsearch.findzip.value;
{
document.weathermagnet.src='// alert("You Chose " + zipcodepars)
// document.write(zipcodepars)
// document.write("<a name=weathermagnetlink
this is the trouble area - using the zipcodepars variable in a pre-defined http: address
}
}
What I want to do is use the zip code and parse that zipcode into the http address, accept I need it to do this in the .js file within the GO function.