?
Solved

PHP Code for Pop Up Message

Posted on 2013-01-28
4
Medium Priority
?
337 Views
Last Modified: 2013-01-28
I have the following line of code in one of my .php pages.

<td> <center> <a href="assign.php?id=<?php echo $row['fid'];?>"> <center> Assign </center> </a> </center> </td>

Open in new window


When a user clicks on the ASSIGN link on th epage they get sent to the assign.php page. My question is, how can I edit this line of code so when a user clicks the ASSIGN link, a pop up box will pop up saying are you sure, bla bla bla, if so click OK" & once they click OK, they get sent to the assign.php page?

I've tried using javascript onclick commands but just can't seem to get it right. Can someone help me out?
0
Comment
Question by:wantabe2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 42

Expert Comment

by:sedgwick
ID: 38828090
Use:

Var result=confirm('some Message');
http://www.w3schools.com/jsref/met_win_confirm.asp
0
 
LVL 15

Author Comment

by:wantabe2
ID: 38828397
I think that's more than I need in the example from the website. I tried this & it's not working either:

<td><center><a href="assign.php?id=<?php echo $row['fid'];?>"> Var result=confirm('some Message');Assign</center></a></td>
0
 
LVL 35

Accepted Solution

by:
Robert Schutt earned 2000 total points
ID: 38828479
You can actually use the return value from confirm() directly to cancel the click on the link:
<a href="assign.php?id=x" onclick="return confirm('Are you sure?');"> <center> Assign </center> </a>

Open in new window

0
 
LVL 15

Author Closing Comment

by:wantabe2
ID: 38828524
After editing it, Your code did exaclty what I needed it to do. Thanks
0

Featured Post

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

These days socially coordinated efforts have turned into a critical requirement for enterprises.
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question