View Single Post
Old 12-09-2012, 07:20 AM   PM User | #1
buckminster83
New to the CF scene

 
Join Date: Dec 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
buckminster83 is an unknown quantity at this point
Submit to make active variable

Hi! New here, but was hoping to get this figured out in the next day or two.

I'm working on a project where the User enters a Zip code and on Submit, the Zip Code is available under the variable "zip".

I've been trying a lot of things, so either this coding is close or may not make sense at all. I'm using it to get the already stored "zip" from Yahoo's simpleWeather. At the bottom of this coding, the last line reads that I'm assigning "zip" the function "zipfx" in hope that "zip" will run the function which grabs the zip code entered from the form. I appreciate any help ASAP!

My current HTML:
<form name="zipSearch" action="" method="post">
<fieldset>
<input type="text" name="zipEntry" placeholder="Enter Zip Code" value=""/>
<input type="submit" name="zipSubmit" value="Search" onClick="zipfx()"/>
</fieldset>
</form>

My current JS:
function zipfx(){

var zipd= document.forms["zipSearch"]["zipEntry"].value;
return zipd;
}

var zip = zipfx();




---
buckminster83 is offline   Reply With Quote