I have a form that retrieves a zip code using Request.Form method. This form has a button that I would like to pass the value of the zip code to a javascript function that will contain a window.open method. The problem is that say if I enter a zip code that starts with a "0", like 04910. Then the "0" is dropped from the value when it goes to the javascript function.
ASP form code
javascript call
The value shown in the alert box is '4910' instead of 04910. So, is zero a reserve character and how do I make sure that preceeding zeros get passed to javascript?
Todd
ASP form code
Code:
zipcode = Request.Form("zipcode")
<input type="submit" value="Yes" onClick="openWin(<%=zipcode%>)" />
javascript call
Code:
function openWin(zip)
{
alert("zip: " + zip);
//window.open("[URL unfurl="true"]http://www.w3schools.com");[/URL]
/*window.open(<i>URL,name,specs,replace</i>);*/
}
The value shown in the alert box is '4910' instead of 04910. So, is zero a reserve character and how do I make sure that preceeding zeros get passed to javascript?
Todd