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 6840321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:49:45+00:00 2026-05-26T23:49:45+00:00

look at this code : [WebMethod] public static string GetFacilities(string id) { int hotelid

  • 0

look at this code :

[WebMethod]
public static string GetFacilities(string id)
{
    int hotelid = System.Convert.ToInt32(Tools.DecryptString(id));

    string ret = "";

    foreach (var item in new FacilityGroupBL().Load())
    {
        if(item.Facilities.Count != 0)
        {
            ret += "<fieldset>";
            if (item.Facilities.Count() != 0)
            {
                foreach (var subitem in item.Facilities)
                {
                    if (subitem.HotelFacilities.Where(obj => obj.HotelId == hotelid).Count() != 0)
                        ret += "<input type='checkbox' checked='false' />" + subitem.Name;
                    else
                        ret += "<input type='checkbox' checked='true' />" + subitem.Name;
                }
            }
            else
            {
                ret += "There is no facility in this fieldset.";
                ret += "</fieldset>";
            }
        }
    }

    return ret;

}

by this code i load some checkboxes in a DIV,then user change some checkboxes and press the SAVE button.at this time ,i should send the values of these checkboxes to server to update my data in database.by i dont know how?:( please help

note: my default code for this probem is here but it does not work($(“#FacilitiesDIV input[type=checkbox]”).serializeArray() is empty)

$.ajax({
    type: "POST",
    url: "HotelsList.aspx/SaveFacilities",
    data: "{ 'id' : '" + $("#HiddenField").val() + "', 'Facilities' : '" + $("#FacilitiesDIV input[type=checkbox]").serializeArray() + "' }",
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    success: function (data) {

    },
    error: function () {
        $('#dialogMessage').dialog('open');
        $('#dialogMessage span').html("Operation Error");
    }
});
  • 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-05-26T23:49:45+00:00Added an answer on May 26, 2026 at 11:49 pm

    $(“#FacilitiesDIV input[type=checkbox]”).serializeArray() since you are referring element using “#” then you need to give the fieldset element an Unique ID assuming you have
    html like

     <fieldset>  <input type='checkbox' checked='false' /> some text
                 <input type='checkbox' checked='false' /> some text 
        </fieldset>
    
    set the id to element <fieldset id = 'FacilitiesDIV'>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Take a look at this code: public class Test { public static void main(String...
Look at this Java code: class PerformanceTest2{ public static void main(String args[]){ Long sum
take a look at this example code: public class Comment { private Comment() {
Look at this code snippet: Size::Size(int iSetWidth, int iSetHeight) :iWidth(iSetWidth), iHeight(iSetHeight) { } Supposedly,
look at this code: int data=5; void Thread1() { if(data==5) { //nothing } }
Please have a look on this code: #include <unistd.h> #include <stdlib.h> #include <stdio.h> int
Look at this code: var a:Number = 1; var b:String = hello; if (a
Please look at this code int i = 10; //line 1 int *p =
Please look at this code: int page; int stop = FALSE; while (!stop) {
Have a look at this code: #include <iostream> using namespace std; int main() {

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.