Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

PHP Code for Pop Up Message

Posted on 2013-01-28
4
Medium Priority
?
341 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:Meir Rivkin
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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)
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

636 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