auto submit, but can't get it to grab query(zipcode), javascript |
auto submit, but can't get it to grab query(zipcode), javascript |
jason2679302 |
Mar 11 2009, 11:38 PM
Post
#1
|
Group: Members Posts: 8 Joined: 4-March 09 Member No.: 7,956 |
Hi, this code works 99% the only thing it won't do is grab the zipcode from query form before it auto submits which is stored in cookie that restores all form fields on the entire page.
If you click the submit button it will refresh the box with the correct weather! I need the auto submit to get the variable v from the user input which is autopasted on pageload. If you need the cookie.js, i will post, because it says it won't attach. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"><head> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" /><title>resize</title> <script language="JavaScript" src="cookies.js"> </script> <script language="JavaScript"> <!-- function ShowWebSite(){ var v = document.all("searchTextalt").value; document.all.myFrame.src="http://www.rss-info.com/rss2.php?integration=if&windowopen=1&rss=http://weather.yahooapis.com/forecastrss?p=" + v + "&number=10&width=300&ifbgcol=FFFFFF&bordercol=D0D0D0&textbgcol=F0F0F0&rssbgcol=F0F0F0&showrsstitle=1&showtext=1"; document.all.myFrame.style.visibility="visible"; } // --> </script> </head> <body bgcolor="gray" onLoad="retrieve_field(document.form1.searchTextalt);"> <basefont face="Verdana, Arial, sans-serif"> <br> <br> <a href="http://zip4.usps.com/zip4/citytown.jsp">Find A Zip Here - USPS</a> <br> <br> <iframe id="myFrame" frameborder="0" vspace="0" hspace="0" marginwidth="0" marginheight="0" width="274px" scrolling="no" height="280" style="BORDER-RIGHT: black 1px solid; BORDER-TOP: black 1px solid; Z-INDEX: 999; LEFT: 400px; BORDER-LEFT: black 1px solid; BORDER-BOTTOM: black 1px solid; POSITION: absolute; TOP: 280px; visibility:hidden;"> </iframe> <form name="form1" method="post" action=""> Enter Zipcode: <input type="text" id="searchTextalt" size="5" NAME="searchTextalt" onChange="save_field(document.form1.searchTextalt)" value=""><br> <input type="button" id="Button1" name="Button1" onclick="return ShowWebSite();" value="Show Local Weather"><br> </form> <script language="JavaScript" type="text/javascript"> <!-- document.form1.Button1.onclick(); //--> </script> </body></html> |
jason2679302 |
Mar 12 2009, 01:54 AM
Post
#2
|
Group: Members Posts: 8 Joined: 4-March 09 Member No.: 7,956 |
i fixed the script already, thanks for reading...you may delete or ask me for this VERY NICE solution for a free javascript weather script while also saving inputing zipcode in a cookie =)
|
Frederiek |
Mar 12 2009, 04:18 AM
Post
#3
|
Programming Fanatic Group: Members Posts: 5,146 Joined: 23-August 06 From: Europe Member No.: 9 |
Ok, good for you you found your own solution! So I won't PM you back, as there is no longer any need to.
|
Lo-Fi Version | Time is now: 23rd April 2024 - 06:35 AM |