wordpress - How to make href="#" work like a submit button in PHP? -
i have table click contents , show new table below on same wordpress pluggin admin page content details (created php function pop_details() passing href value reference), oracle child forms.
unfortunately, code not working (nothing happens when click href link rest of buttons working), purist when comes code :d don't want submit button transparent background (besides nicer way) if can me, surely appreciate it. thank you.
table details:
... echo "<td><a href='#' name='order_selected' value='".$mydata->orderid."'>" .$mydata->orderid."</td>"; ...
isset:
<?php if (isset($_post['order_selected'])) { $myordersel = $_get['order_selected']; pop_details($myordersel); } ?>
1) have use <form>
hidden element if wan't retrieve post values using static method...
2) otherwise, can use ajax call using jquery example :
$('a').click(function() { $.ajax({ url : $(this).attr('href'), data : {$(this).attr('name') : $(this).attr('value')} }); });
3) or can use values using href :
"<a href='#?order_selected = ".$mydata->orderid."' name='order_selected' value='".$mydata->orderid."'>"
and retrieve in php :
isset($_get['order_selected'])
to clear
this php code works :
<?php if(isset($_get['test'])) { exit($_get['test']); } echo "<a href='?test=mytest'>this test</a>"; ?>
Comments
Post a Comment