Forum Moderators: open

Message Too Old, No Replies

Form for Humans

need a real click

         

vccubed

11:02 pm on Mar 7, 2008 (gmt 0)

10+ Year Member



I tried adding a nice little link to the content pages so a user could click and a small window would open and tell them the phone number. Was hoping to offset the number of people who want the info but won't fill out a form. Within hours of my brilliant new idea I have a 30 to 1 bots/crawlers to humans running my link (that is forbidden in robots.txt). So I decided to make it a form instead and pass more information along.

Problem I'm having is the variables don't pass along in the form.

<FORM>
<input type="hidden" name="doc" value="<%=doc%>">
<input type="hidden" name="procid" value="<%=procID%>">
<input type="hidden" name="cityid" value="<%=CityID%>">
<input type="hidden" name="referpage" value="<% =pagename %>">
<INPUT type="submit" value="New Window!" onClick="window.open('/procedures/DoctorPhone.asp','mywindow','width=300,height=200')">
</form>

Clicking this opens the correct file but with none of the variables passed through

gergoe

3:01 am on Mar 8, 2008 (gmt 0)

10+ Year Member



The onclick handler in the submit button will open a new window indeed, but the content of the form (where the submit belongs to) will not be posted to that window, the url will be opened using a normal http get method instead. The form will be still posted, but in the current window - resulting in more or less a page reload.

If you don't want the popup window to be customized (leave it up to the browser how it will look like), set the <form>'s target attribute to _blank.

If you want to change some aspects of the popup window (like the width and height in your example), then see this thread [webmasterworld.com] for more information on how to do that.