I use Yii2 Framework and this is my form:
<?= $form->field($model, 'RIDBibliografia')->textInput(['maxlength' => true, 'style'=>'width:200px', 'format'=>'html'])->label('Numero di sistema edizione') ?>
<button type="button" name="button" id="btnMostra">Clicca per mostrare/nascondere le edizioni</button>
AND this is my js code:
<script type="text/javascript">
$(function () {
//Assign Click event to Button.
$("#btnGet").click(function () {
var message = "";
var griglia = $('.edizioni');
//Loop through all checked CheckBoxes in GridView.
$("#grid-biblo input[type=checkbox]:checked").each(function () {
var row = $(this).closest("tr")[0];
message += row.cells[1].innerHTML;
});
//Display selected Row data in Alert Box.
//alert(message);
document.getElementById("citazioni-ridbibliografia").value=message;
$(griglia).hide();
return false;
});
});
</script>
If I click the button, in the input show this value:
<p style="font-style:italic;color:#636363;"> 486</p>
Instead of only 486. How can I remove the html tag? I want to display only the number value. Anyone can help me?? Thank you!!!!
THIS IS THE COLUMN:
['attribute' => 'IDBibliografia',
'value' => function ($model,$key,$index,$widget) {
if($model->RIDStatoBibliografia === 3) {
return "<p style='font-style: italic; color: #636363;'>"." ".$model->IDBibliografia."</p>";
} else {
return $model->IDBibliografia;
}
},
'format' => 'html',
'width'=>'7%',
'label' => 'Num. sis. BIB',
],