
December 18th, 2000, 09:54 PM
|
|
Contributing User
|
|
Join Date: Dec 2002
Posts: 14,578
  
Time spent in forums: < 1 sec
Reputation Power: 22
|
|
|
Passed values Using Onclick event of Input type=button
<i><b>Originally posted by : Arbil (rickysantos.com)</b></i><br />I have this asp page which contains several forms. One form has a Submit and a Button. The Submit button has an ONCLICK event which is triggering a specified asp page on a targeted frame. Here's the Code:<br /><br /><form name="bmcform" method="Post" target="MapFrame"><br /><br /><select name="lCity" id="lCity"><br /> <option value="San Juan">San Juan</option><br /> <option value="Valenzuela">Valenzuela</option> <br /></select><br />....<br />....<br /><select name="lClass" id="lClass"><br /> <option value="AIRLINE COMPANY">AIRLINE COMPANY</option><br /> <option value="APARTMENT">APARTMENT</option><br /></select><br />....<br />....<br /><br /><input type="Submit" value="Show" name="submit" onclick="this.form.action='newsmc.asp';"><br /><br />This works fine. The other Button, when clicked will open a new window passing the selected values from the two options into the new page.<br /><br />Here's the Input Button:<br /><br /><input type="Button" value="List" name="bmclist" onclick="window.open('bmc.asp?lCity=<%Request("lCity")%>&lClass=<%Request("lClass")%>','bmcwin1','toolbar=no,location=no,directories=no ,status=yes,menubar=no,scrollbars=yes,resizable=ye s,copyhistory=yes,width=300,height=500')"><br /><br />There is no process done in the calling page. It is just a button calling a new page which passes the selected values from the two Options.<br /><br />But I can't seem to get the passed values in the opened page.<br /><br />Here's the code I used in the 2nd page to get the passed values:<br /><br />lClass2 = ucase(Trim(Request.Querystring("lClass")))<br />lCity2 = lcase(Trim(Request.Querystring("lCity")))<br /><br />And I made an instant response.write to see if I get the values:<br /><br />Response.Write lClass2<br />Response.Write lCity2<br /><br />What is wrong with this? How can I get the value from the 1st page and passed it in the other page using ONCLICK event of an INPUT type=Button?<br /><br />Need your help/ideas? Thanks in advance.<br />
|