You are not logged in.
Hi everyone,
Is it possible to validate a getBeginHiddenFieldValue ('locations_id') field with ajax?
for example:
I have this Location field and I would like to validate if it is a value = 0 so, activate ajax and avoids sending the form until the user selects a field.
echo "<tr class='tab_bg_1'><th width='$colsize1%'>".$tt->getBeginHiddenFieldText('locations_id');
printf(__('%1$s%2$s'), __('Location'), $tt->getMandatoryMark('locations_id'));
echo $tt->getEndHiddenFieldText('locations_id')."</th>";
echo "<td>";
echo $tt->getBeginHiddenFieldValue('locations_id');
if ($canupdate) {
Location::dropdown(['value' => $this->fields['locations_id'],
'entity' => $this->fields['entities_id']] );
}
else {
echo Dropdown::getDropdownName('glpi_locations', $this->fields["locations_id"]);
}
echo $tt->getEndHiddenFieldValue('locations_id', $this);
echo "</td></tr>";
You will save my life !
Last edited by anndyrl (2019-11-27 17:16:42)
Offline