I have an accordion panel with two panes in it. First pane has search criteria and second pane has a grid view.
In the first pane, the search criteria has few controls - dropdown lists, text boxes. When i enter some data in these controls and click search, i want to access these values in Java Script and do some validations. Please let suggest me how to do this.
siva-karthik
Member
13 Points
41 Posts
Find Control in Accordion Pane, from Java Script
Mar 01, 2012 06:22 AM|LINK
Hi,
I have an accordion panel with two panes in it. First pane has search criteria and second pane has a grid view.
In the first pane, the search criteria has few controls - dropdown lists, text boxes. When i enter some data in these controls and click search, i want to access these values in Java Script and do some validations. Please let suggest me how to do this.
Thanks in Advance.
Regards,
Karthik
Hem Singh
Participant
1051 Points
235 Posts
Re: Find Control in Accordion Pane, from Java Script
Mar 01, 2012 06:57 AM|LINK
hi try this way:
<script type="text/javascript"> function hpVali() { var _txtBoxName = document.getElementById('<%=txtBoxName.ClientID%>'); if (_txtBoxName.value == "") { alert("please enter name"); _txtBoxName.focus(); return false; } else return true; } </script>or can also try if it will not work:
var _txtBoxName = document.getElementById('<%=Accordion1.FindControl("txtBoxName").ClientID%>');then call this function on submit button's OnClientClick="return hpVali()"
Hem Singh
siva-karthik
Member
13 Points
41 Posts
Re: Find Control in Accordion Pane, from Java Script
Mar 01, 2012 08:30 AM|LINK
Both are working fine
Thanks for the help Hem, infact quick help. :)