HI,
How to develop dependent drop down . I stuck in back-bone js that how i can get value of drop down.
and according to that i want populate another drop down.
Thank you
HI,
How to develop dependent drop down . I stuck in back-bone js that how i can get value of drop down.
and according to that i want populate another drop down.
Thank you
Hi Shiv Gawande
This post may help you.
If you want to do it from js file then do to so;
create-actions.js file
under initialize: function()
After this._super("initialize", [options]);
this.events['change input[name=your-fieldname]'] = 'getOptValue';
Then under getOptValue function :
getOptValue: function (elem) {
var firstDropValue = this.model.get('firstDropFieldName');
$.ajax({
type: "POST",
data: {firstdpvalue: firstDropValue},
url: 'get_secondDrop_list.php', // In this file get the value of first dropdown based on that get second dropdown values and return data in json
dataType: 'json',
success: function(json) {
var $el = $("#SecondDropFieldID");
$el.empty();
$el.append($("<option></option>").attr("value", '').text('Please Select'));
$.each(json, function(value, key) {
$el.append($("<option></option>").attr("value", value).text(key));
});
}
});
}
Hope this Helps
Best Regards
S Ramana Raju
Your post is working great..
If i have option of putting Correct Answer.. i would have given you.
Thanks
Sam
i have try for status field in case module . but not working..
var $el = $('input[name=status]');
$el.empty();
$el.append($("<option></option>").attr("value", 'AC').text('Please Select'));
what i have did wrong. ?