Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8201679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T06:53:52+00:00 2026-06-07T06:53:52+00:00

I want to store the value returned from a webservice to a hidden field

  • 0

I want to store the value returned from a webservice to a hidden field in jquery

  $.ajax({
        type: "POST",
        url: "/AutoComplete.asmx/CompareGroupName",
        data: { Text: text },
        dataType: "json",
        onfocusout: function (element) {
            $(element).valid();
            $(element).filter('.valid').qtip('destroy');
        },
        success: function (data) {
            response($.map(data.d, function (item) {
                return {
                    value: item.igroup_id

                }
                $('#hdnGroupNameCheck').val = item.igroup_id;

            }))
        },


        complete: function (xhr) {
            if (xhr.status == 200) {
                alert("Group Name already exist");


            }
            else
                alert("Group Name does not exist");
        }

    });

I am getting Group already exists and Group does not exist and webservice is running fine.
But how to get the id in the hidden field and display the same message through code behind in asp.net.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T06:53:53+00:00Added an answer on June 7, 2026 at 6:53 am
      function ontextchange() {
        if ($('#<%=txtGroupName.ClientID %>').val() != "") {
            $('#<%=lblGroupName.ClientID %>').text($('#<%=txtGroupName.ClientID %>').val());
        }
        var text = $('#<%=txtGroupName.ClientID %>').val();
    
        $.ajax({
            type: "POST",
            url: "AutoComplete.asmx/CompareGroupName",
            data: "{'Text':" + JSON.stringify(text) + "}",
            // async: false,
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: comparegroup,
            error: function (msg) {
                return false;
            }
    
        });
        return false;
    
    }
    
    function comparegroup(msg) {
        populatecontrol(msg.d, $("#<%=lblGroupNameCheck.ClientID %>"));
    
    }
    
    function populatecontrol(list, control) {
        var id = 0;
        var GroupName = document.getElementById('<%=hdnGroupNameCheck.ClientID %>');
        if (list.length > 0) {
            $.each(list, function (key, value) {
                var obj = JSON.parse(value);
                document.getElementById('<%=hdnGroupNameCheck.ClientID %>').value = obj.Second;
                $('#lblGroupNameEdit').show();
                control.html("Group already exist.Click here to");
                $('#<%= lblGroupNameEdit.ClientID%>').text("edit or");
                $('#<%= lblGroupNameInquire.ClientID%>').text("inquire");
    
            });
            return false;
        }
        else
            $('#<%= lblGroupNameCheck.ClientID%>').text("");
            $('#<%= lblGroupNameEdit.ClientID%>').text("");
            $('#<%= lblGroupNameInquire.ClientID%>').text("");
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to store the value returned from hashUnique into a list, but I
I want to call a JavaScript function through PHP and store the returned value
I want to store some value from SQLite database in my buffer, but the
Hi I want to access the value in an XML feed: <entry> <ilink:operation>store</ilink:operation> <ilink:type>ondemand</ilink:type>
basically i want to hold a parameter that retrieve value from $.post() call like
I want to run 2 functions in parallel and use a returned value from
I want to store the href value in a cookie, trouble is when i
I want to store every single character of a string value in every single
If I have a class with some value member that I want to store
I'm lazy! And I just want to store one single string value. That's all!

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.