You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2019-11-27 17:10:40

anndyrl
Member
Registered: 2019-11-21
Posts: 10

Validar getBeginHiddenFieldValue('id') con ajax

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

Board footer

Powered by FluxBB