Forum Moderators: open

Message Too Old, No Replies

passing form input in a popup window

         

aanton05

3:54 am on Dec 9, 2005 (gmt 0)

10+ Year Member



hi. this is what i want to do. i want to be able pass values entered via a form to a popup window(via URL query string). what i want to do is create a javascript code that is called when someone clicks on a link. when somebody clicks on this link, it will open up the popup window. Thanks.

aanton05

5:33 am on Dec 9, 2005 (gmt 0)

10+ Year Member



hi. this is an example of what i am trying to do.

<form name="frmCalendar">
<input name="txtDate" type="text" />
<a href="javascript:calendar_window=window.open('/calendar.aspx?formname=frmCalendar.txtDate','calendar_window','width=154,height=188');calendar_window.focus()">
Calendar
</a>
</form>

However, the url that i am getting for the popup window is

[sitename.com...]

what i am trying to do is pass the text box form field to the url of the popup window.

instead of

[sitename.com...]

i want

[sitename.com...]

where john is the value of the form input.

RonPK

3:10 pm on Dec 12, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi, try this instead for the window.open part:


window.open('/calendar.aspx?formname=' + escape(frmCalendar.txtDate.value) , 'calendar_window', [..]

It reads the value of the field frmCalendat.txtDate and escapes it for safer usage in URLs.