The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> auto submit, but can't get it to grab query(zipcode), javascript
jason2679302
post 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! smile.gif 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. smile.gif

<!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>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
jason2679302
post 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 =)

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Frederiek
post 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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 23rd April 2024 - 06:35 AM