-1

I have the list of records like this

o 1 xxx yyy
o 2 xxx yyy
o 3 xxx yyy

if i click the first record radio bhutton, the value of 1 pass to anchor tag

    <?php foreach($model as $result) { ?>
        <tr>    
            <td>
                <input type="radio" name="pol_id" value="<?=$result['id']?>" />
                <?=$result['name']?>
            </td>
            <td><?=$result['country']?></td>
            <td><?=$result['state']?></td>
        </tr>
    <?php } ?>
    <tr>
        <td align="right">
            <a href="update?id=<?=$result['id']?>">Edit
        </td>
    </tr>
Glavić
  • 42,781
  • 13
  • 77
  • 107
GuruKumar
  • 61
  • 1
  • 10

1 Answers1

0

You need to use javascript for it.

jQuery Code:

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script>$(function(){
  $('input:radio').change(function(){
    $('a').attr('href', 'update?id='+$(this).val()); // better if you add an id to anchor & then $('a#idofAnchor')
});

});</script>
Apul Gupta
  • 3,044
  • 3
  • 22
  • 30