1

i have included a confirm box in my PHP page which works fine the following is the code

<a href="" onclick="return confirm('Acc No :   \nCANDIDATE NAME :   \n\nPLEASE CONFIRM ')" >hi</a>

now i want to display value returned by PHP after Acc NO and CANDIDATE NAME i have written a code which is not working the code is below

<a href="" onclick="return confirm('AIN NO :<?=fetchresullt['acc_no']; ?>   \nCANDIDATE NAME : <?=fetchresullt['acc_candidatename']; ?>   \n\nPLEASE CONFIRM ')" >hi</a>

please help me out

1
  • 1
    can you please try like this <?php echo $fetchresullt['acc_no']; ?> Commented Apr 23, 2014 at 8:42

2 Answers 2

1

Try with this

<a href="" onclick="return confirm('AIN NO : "<?php echo fetchresullt['acc_no']; ?>"   \nCANDIDATE NAME : "<?php echo fetchresullt['acc_candidatename']; ?>"   \n\nPLEASE CONFIRM ')" >hi</a>
Sign up to request clarification or add additional context in comments.

Comments

0

Are you sure fetchresullt['acc_no'] is spelt correctly? Doesn't it need to be a variable? ie:

<?=$fetchresult['acc_no']?>

Also make sure you are not including it in a .js file, but make it inline JS code in a .php file.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.