Good afternoon, I have the following code:
<asp:GridView runat="server" Style="border: 0px !important;" ID="gdvDadosHistoricoMedico" OnRowDataBound="gdvDadosHistoricoMedico_RowDataBound"
AutoGenerateColumns="false" ShowHeader="false" Visible="false">
<AlternatingRowStyle />
<RowStyle />
<Columns>
<asp:TemplateField>
<ItemTemplate>
<local:UCHistoricoAtendimentoMedico runat="server" ID="UCHistoricosAtendimentoMedicos" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
Inside the user control I have fields that I would like to get the value with jquery when clicking a button:
<div class="col-sm-4">
<governa:GVNCalendar ID="cldDataMedicamento" DiasLimiteFinal="7" Tipo="Data" runat="server" Requerido="True" />
</div>
<div class="col-sm-1">
<asp:Label ID="lblCMHora" Text="Hora" runat="server"></asp:Label>
</div>
<div class="col-sm-4">
<governa:GVNCalendar ID="cldHoraMedicamento" Tipo="Hora" ClientIDMode="AutoID" runat="server" Requerido="True" />
</div>
<asp:HiddenField ID="hdfCodPrescricaoObservacao" runat="server" />
<asp:HiddenField ID="hdfCodUsuarioResponsavel" runat="server" />
<asp:HiddenField ID="hdfNomUsuarioResponsavel" runat="server" />
<div class="col-sm-1">
<button ID="GravarHorario" onclick="AdicionarNaTabela()">Clique</button>
</div>
What would be the javascript / jquery code to get the value? I tried the following and it did not work:
function AdicionarNaTabela() {
var cldDataMedicamento = $('#<%=cldDataMedicamento.ClientID %>').val;
var cldHoraMedicamento = $('#<%=cldHoraMedicamento.ClientID %>').val;
var hdfCodPrescricaoObservacao = $('#<%hdfCodPrescricaoObservacao.ClientID %>').val;
var codProfissional = $('#<%=hdfCodUsuarioResponsavel.ClientID %>').val;
var nomProfissional = $('#<%=hdfNomUsuarioResponsavel.ClientID %>').val;
}