473,396 Members | 1,970 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

ajax JQuery - multiple data parameters

77
hello, i have this function..

Expand|Select|Wrap|Line Numbers
  1. function getAllInfoCab()
  2. {
  3.     var slmckdcoy = $("#companyCode").val();
  4.     var slmckdcab = $("#branchCode").val();
  5.     alert(slmckdcoy);
  6.     alert(slmckdcab);
  7.     $.aja{
  8.            url: "getAllInfoCab",
  9.            global: false,
  10.            type: "POST",
  11.            async: false,
  12.            dataType: "html",
  13.            data: "companyCode="+ slmckdcoy,
  14.            success: function (response) {
  15.                        var dynamic_options = $("*").inde $('.dynamic')[0] );                   
  16.                        if ( dynamic_options != (-1)) $(".dynamic").remove();
  17.                     $("#salesmanCode").append(response);
  18.                     $(".first").attr({selected: ' selected'});
  19.                    }
  20.           });
  21.  
you see this below script from the function

data: "companyCode="+ slmckdcoy

that is just one data companyCode that throw through the controller, the question is can i add another data (branchCode) to the data property of ajax??

so, beside companyCode, i want to add branchCode also to the data property.
any idea??

thanks
Oct 22 '08 #1
4 36341
acoder
16,027 Expert Mod 8TB
maminx, as a full member now and having received gentle nudges and warnings in past on this very issue, you should know that we expect your code to be posted in [code] tags (See How to Ask a Question). This is your final warning. Any more infringements will lead to a temporary ban which I'm sure you'd like to avoid.

Please use the [code] tags in future.

Moderator.
Oct 22 '08 #2
acoder
16,027 Expert Mod 8TB
you see this below script from the function

data: "companyCode="+ slmckdcoy

that is just one data companyCode that throw through the controller, the question is can i add another data (branchCode) to the data property of ajax??
Use the & as you would in a normal GET request. See example.
Oct 22 '08 #3
maminx
77
Use the & as you would in a normal GET request. See example.

so sorry for inconvenient of using the tag...thanks moderator for the warning...

thanks also for the solving..i've solved the problem with this below

data: "companyCode="+ slmckdcoy +"&branchCode="+ slmckdcab,

so it is passing two object (companyCode and branchCode)

thanks a lot..

regards,
maminx
Oct 22 '08 #4
acoder
16,027 Expert Mod 8TB
No problem. Glad to help.

PS. I haven't checked if jQuery does this automatically, but if not wrap values/variables in encodeURIComponent().
Oct 22 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Nathan Sokalski | last post by:
I am a beginner with AJAX, and have managed to learn how to use it when passing single parameters, but I want to return more than one value to the client-side JavaScript function that displays it....
3
by: BG Mahesh | last post by:
hi We are looking for a good Ajax library which has very good support for iframe. The ones we have considered so far are, Backbase.com - not happy with the speed Zapatech.com - it is good but...
10
by: sfmcfar | last post by:
Hi, Can someone recommend an Javascript toolkit that provides both AJAX- like requests and effects, and that supports IE 5.5+, Firefox 1.5+, and Netscape 7+? I know that NS7 may not be as...
1
by: c19h28o2 | last post by:
Hi, I'm a little stuck with Ajax (really am not getting it at the moment!) I'm trying to write into a div when something is typed into a box... <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML...
4
by: JJ | last post by:
I want to be able to display items and their categories on a page, so that the user can click on an item to edit it, or add further items or categories. Simple enough, however, I want to do it...
3
by: NetWave | last post by:
Hi, For my next project I'm going to need Ajax, so I'm in about to read some books on ASP.NET Ajax. While reading Rick Strahl's blog I stumbled upon jQuery. I've been to the website and seen...
9
by: Caper | last post by:
Hello everyone, I can’t decide which Ajax framework(s) I should take in my project since I am a newbie in the Ajax world. The main task of this project relates to online examining in all middle...
1
by: =?Utf-8?B?TW9oc2luIEtoYW4=?= | last post by:
Hi, I am working on a website where i am creating Horizontal Menus Dynamically from database as per rights available to the user. I have several UserControls. And the Menu control also brings...
3
by: George | last post by:
I am doing an AJAX call using JQuery on my page to which returns JSON objects and everything works fine. Now I decided to use ashx handler instead of and simply write JSON out. Then my problems...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.