SharePoint Hide a list field based on user group

A field in a SharePoint list form like NewForm.aspx or EditForm.aspx can be easily hidden by using the following Jquery statements. Assume that we have an input field named Feedback

var feedbackField = $("input[title=Feedback]");
But what if we want to hide the field for a particular SharePoint user group only. Let's say we have a user group named "Test Group" and we don't want to show the Feedback field to the users of this group. In order to achieve this we need to know whether the current logged in user belongs to the "Test Group" or not.This can be done by using  SPServices, a Jquery library for SharePoint web services.
Grab the latest version of SPServices Jquery library from codeplex and Jquery from here.
Once you have both .js files, upload them to a SharePoint document library. In my case I created a folder named JS inside Shared Documents Document library and uploaded both files inside it. Next Create any SharePoint list and create a Text column named Feedback in it. Now we will add a content editor webpart to the NewForm.aspx page of this list. In order to edit the NewForm.aspx page append 
?PageView=Shared&ToolPaneView=2 to the NewForm.aspx page in the url. Your url should look something like this http://ws2003/Lists/Project%20Tasks/NewForm.aspx?PageView=Shared&ToolPaneView=2. Now add a content editor webpart to the page and the following script to the content editor webpart.

<script type="text/javascript" src="/Shared%20Documents/JS/jquery.min.js"></script>
<script type="text/javascript" language="javascript" src="/Shared%20Documents/JS/jquery.SPServices-0.6.2.min.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function() {
    operation: "GetGroupCollectionFromUser",
    userLoginName: $().SPServices.SPGetCurrentUser(),
    async: false,
       completefunc: function (xData, Status) {
       var xml = xData.responseXML.xml;
       if ('Test Group') != -1)
         var feedbackField = $("input[title=Feedback]");

The SPServices method GetGroupCollectionFromUser gets all the groups of a particular user and $().SPServices.SPGetCurrentUser() supplies the current user as input parameter to the GetGroupCollectionFromUser. A user may belong to several groups, so we need to find whether the user belongs to the group we are interested in (Test Group in our case). In the original code sample present here , this is done by using Jquery find method if($(xData.responseXML).find("Group[Name='GroupName']").length == 1) but this did not seem to work for me. So I had to use javascript search method. Same script can be added in EditFrom.aspx page as well.