Custom button no functioned
Posted: 2021-02-26 21:42
Hi,
I want to make a button on Detail View and use it to open other table based on the data in current table. But when I click the button it just refresh the current table.
What is the problem?
My code is like this, on footer-extra.php:
I want to make a button on Detail View and use it to open other table based on the data in current table. But when I click the button it just refresh the current table.
What is the problem?
My code is like this, on footer-extra.php:
Code: Select all
var url = $j('#Penilaian_Penyelia_link').attr("href");
var pid = <?php echo $PenyeliaID;?>;
var url2 = url + "addNew_x=1&filterer_penyelia=" + pid;
$j('#Penilaian_Penyelia_link').attr("href",url2)
$j('#Pengajaran_dv_action_buttons #deselect').before('<button id="penilaianpenyelia" class="btn btn-success" type="submit" name="insert_x" value="1" onclick="location.href=\'' + url2 + '\'"><i class="glyphicon glyphicon-plus-sign"></i> Penilaian Penyelia</button>');
//The button look like this:
//<button id="penilaianpenyelia" class="btn btn-success" type="submit" name="insert_x" value="1" onclick="location.href = 'Penilaian_Penyelia_view.php?filterer_tarikh_tajuk=1&addNew_x=1&filterer_penyelia=2';"><i class="glyphicon glyphicon-plus-sign"></i> Penilaian Penyelia</button>