DOM HTML

FORM HTML:

<form id=”frm_vista” action=”<php echo JRoute::_(‘index.php?option=com_abc&view=vista’);>” method=”POST”>
<a href=”#” id=”text_category”>Insertar Categoria</a>
<a href=”#” onClick=”setBudgetCategory(15, ‘LIMA’)”>LIMA</a>
<input type=”hidden” name=”category_id” id=”category_id” />
</form>

JS:

function setCategory(id_category, category_name){
document.getElementById(‘category_id’).value = id_category;
document.getElementById(‘text_category’).innerHTML = category_name;
}

,

post-author