← Back to team overview

dhis2-users team mailing list archive

Re: Getting input value dhis2

 

Hey Joao,

Both of those statements are slightly incorrect. 

This one is not a jquery selector and looks for the id without the css id identifier (#). Therefore without the # it should work if the id is “cRQPAnXX5wt-DcbtgwkhFxr-val”
The string contains a space between the “#" and the “c” and a trailing space at the end. Therefore it likely does not find the right element. If you remove the spaces it should work if the id is indeed correct.

Kind regards,

Mark Polak
mark@xxxxxxxxxxxxxxx
markpo@xxxxxxxxxx
+47 970 36 752

On 19 May 2015, at 12:28, Joao Mazuze <Joao_Mazuze@xxxxxxxxxxxx> wrote:

> Dear all,
> Can someone help me on how do I get an input id value in a data entry form? I have got two examples but none of them works.
> 1.       var valor = document.getElementById("#cRQPAnXX5wt-DcbtgwkhFxr-val").value;
>  
> 2.       var valor= $("# cRQPAnXX5wt-DcbtgwkhFxr-val ").val();
>  
>       In any case is possible to display “valor” when performing alert(val);
>  
> Is there any other way beyond statements above?
>  
> Kind regards
> _____________________________________
> João Gabriel Mazuze
> National Database Manager
> Projecto CHASS-SMT
> Abt Associates Inc.
> Av. Marginal, 4067
> Cidade de Maputo, Moçambique
> Fax: (+ 258)  21486767
> Tel:  (+ 258)  21493525/6/8
> Cell: (+258) 82 4236279
> www.chasssmt.com
>  
> <image001.jpg>
> Somos um projecto financiado  pelo PEPFAR-II, através da USAID, para reforçar o Sistema de Saúde das Provincias de  Sofala, Manica e Tete. Pretendemos melhorar a ligação e integração do HIV  com os Cuidados Primários de Saúde e outros a ele relacionados em coordenação com as Direcções Provinciais de Saúde e outros parceiros. Através do projecto CHASS-SMT, o Governo Americano apoia o Governo Moçambicano na melhoria da qualidade dos Serviços de Saúde no país.
>  
>  
> 
> 
> This message may contain privileged and confidential information intended solely for the addressee. Please do not read, disseminate or copy it unless you are the intended recipient. If this message has been received in error, we kindly ask that you notify the sender immediately by return email and delete all copies of the message from your system. _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-users
> Post to     : dhis2-users@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-users
> More help   : https://help.launchpad.net/ListHelp


References