Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

open another page when user clicks on a link 1

Status
Not open for further replies.

tyutghf

Technical User
Apr 12, 2008
258
GB
We have an annual report (as a pdf) on some of our pages and want to gain feedback on this.

At the moment the user clicks the link and the pdf opens, is it possible to click the link and a message pops up asking if the user would like to submit their feedback on the report, if they click yes the annual report pdf opens AND the page they opened from (or a new page) opens up a feedback form page. If they click no just the annual report is opened?

Thanks for any help you can give on this.
 
Sure. Use a confirm() box to ask the user and act accordingly.


Code:
function check_feedback(){
  if(confirm("Do you want to give feedback?")){
  window.open("[URL unfurl="true"]http://www.server.com/feedbackpage.html");[/URL]
  return true;
  }
  else{
   return true;
  }
}


...

<a href="report.pdf" onclick="return check_feedback();">



----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.

Behind the Web, Tips and Tricks for Web Development.
 
thanks, I was using an alert box not confirm!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top