Prasad Bolla's SharePoint Blog

Click Here to go through the Interesting posts within my Blog.

Click Here to go through the new posts in my blog.

Friday, January 18, 2013

Getting All Text Box IDS within a SharePoint New Or Edit Form using JQuery and retrieve those IDS and store them with in an array.



Note:-
                The Same way you can do for other controls based on the class the control is  using by default. Using that ID’s we can validate the controls. Suppose if the site is took back up and restored again to other server, then again we do need to change the ID’s manually.
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.3.js"></script>
<script type="text/javascript">
var strTextBoxControls=new Array();
var count=0;
$(document).ready(function()
{
                $(".ms-long").each(function()
                {
                                count++;
                                strTextBoxControls[count]=$(this).attr('id');
                                alert(strTextBoxControls[count] +" TextBox"+count+" ID");
                });
});
</script>

No comments:

Post a Comment