-1
<li><a href="#myModal" data-toggle="modal" data-target="#myModal" data-code="<?php echo "carrer"?>">Career</a></li>

suppose this is a link and I want to send the echoed value carrer to.....

<a class="text_center sign" title="one" href="rashu.php?test=axis"><img class="sign img-circle" src="images/icon/belier.png" alt=""><br>Axis</a>

career should be as after test=axis?carrer=<that echoed value.....>

Praveen Kumar Purushothaman
  • 164,888
  • 24
  • 203
  • 252
eager
  • 33
  • 5

1 Answers1

0

You have two mistakes.

  1. echo a static string carrer which is not need to do.
  2. use " inside ", which is invalid.

Change

data-code="<?php echo "carrer"?>"

to

data-code="carrer" or data-code="<?php echo 'carrer'?>"

Main problem Solution:

fiddle link

jQuery:

$(function(){
    var modal_class = $(".modal_class").attr('data-code');
    var sign = $(".sign").attr("href");

  $(".sign").attr("href", sign+"&test_carrer="+modal_class);
  alert($(".sign").attr("href"));
})
Murad Hasan
  • 9,565
  • 2
  • 21
  • 42
  • Sir, I know i am wrong at it tell me how I can do it correctly......would be a great favour of you........ – eager May 21 '16 at 10:31
  • Little confusing, You need something echo in the `carrer`. But what is the string?? Is it `
    Axis
    `??
    – Murad Hasan May 21 '16 at 10:33
  • Is this possible or not..........to send a value of this data-code to the other llink.. – eager May 21 '16 at 10:34
  • make other link a sting like `$carrer = 'Link';` and echo it in `data-code=""` – Murad Hasan May 21 '16 at 10:38
  • I think u took my question a bit wrong.....I want to send this data-code value to other link as a request parameter.......... – eager May 21 '16 at 10:40
  • Check this link http://stackoverflow.com/questions/27027186/php-how-to-put-and-passing-variable-in-modal-url – Nitin Rajan May 21 '16 at 10:43
  • sir, I just want to send this data-code value to the request parameter of a link inside modal(bootstrap), that opens on click of the link disscussed first....... – eager May 21 '16 at 10:50
  • but sir it is adding same carrer in each link........in request parameter as test_carreer=carrer for all the other lnks........ – eager May 21 '16 at 11:48
  • Sir, pardon me, i can;t help you, sorry. – Murad Hasan May 21 '16 at 11:49
  • How can i know you have 100 link or 100000 links???? it is not my business, if you make a question such a way than you can't get that much trouble. – Murad Hasan May 21 '16 at 11:54
  • we are here to help each other out....you are getting annoyed......nevertheless thanku for helping out........ – eager May 21 '16 at 12:34
  • Your question is not too clear as i said earlier, I am annoyed because of my time. – Murad Hasan May 21 '16 at 12:35