TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
prasanna p
1.3k
470
104.1k
How-to-assign-selected-value-from-auto-complete-extender
Sep 25 2016 5:20 AM
hi friends<br /> <br /> I am using auto complete extender using jquery through webservice. I have two textboxes.for both I am using autocomplete extender.<br /><div> Ex:</div><div><pre id="pre646208">Material group Material Name<br /> MaterialGroup1 MaterialName1 <br /> MaterialName2 <br /> MaterialName3 <br />MaterialGroup2 MaterialName4 <br /> MaterialName5</pre> Here my question is when I select materialGroup1 in one textbox through autocomplete extender the corresponding materialnames(from MaterialName1 to MaterialName3) should be populated in auto completeextender in another textbox.<br /> <br /> how to achieve this using jquery.</div><div>here my jquery function is</div><div> </div><div> function SearchText() {<br /><br /> $(".autosuggest").autocomplete({<br /> <br /> source: function (request, response) { <br /> $.ajax({<br /> type: "POST",<br /> contentType: "application/json; charset=utf-8",<br /> url: "MaterialRequestForm.aspx/GetAutoCompleteData",<br /><br /> data: "{'MaterialName':'" + this.term + "'}",<br /> dataType: "json",<br /><br /> success: function (data) {<br /> if (data.d.length > 0) {<br /> response($.map(data.d, function (item) {<br /> return {<br /> label: item.split('/')[0],<br /> val: item.split('/')[1],<br /> <br /> }<br /> }));<br /> }<br /> else {<br /> response([{ label: 'No Records Found', val: -1 }]);<br /> }<br /> },<br /> error: function (result) {<br /> alert("Error");<br /> }<br /> });<br /> },<br /> select: function (event, ui) {<br /> //if (ui.item.val == -1) {<br /> // return false;<br /> //}<br /> var disid = $(this).attr("data-id");<br /> $(".id-group").find(".col-md-12").each(function(){<br /> if (disid == $(this).find("input[type=text]").attr("data-id")) {<br /> $(this).find("input[type=text]").val(ui.item.val);<br /> }<br /> });<br /> <br /> }<br /><br /> });</div><div> </div><div>Here I am assigning material Id to textbox on selection of Material name.<br /> how to populate the data based on selected value in auto complete extender. </div><div> </div><div> </div><div> </div><div> </div><div> </div><div> </div><div> </div><div> </div>
Reply
Answers (
2
)
JQuery , javaScript ,ASP.NEt MVC
show an element if a checkbox is unchecked