-
Add a value in Datalist using Jquery
In a scenario there is a Datalist and there are some Datalist values in that Datalist. When you will click on any Datalist value that value will be invisible from that Datalist and should be shown on vf page with a checkbox and when you will check that checkbox that value will be invisible from page and again should be shown in datalist. I want to solve this problem using JQuery. I have gone through following code but not getting complete solution. Can i get any solution..?
function checkboxClick(obj){
var id = $(obj).attr("id");
if($('#' + id).is(":checked")){
$(obj).closest("tr").remove();
}
}
$(document).ready(function(){
var a;
var idCounter=1;
$(document).on('click', '#ddlList', function () {
a = $('#ddlList option:selected').text();
$('#ddlList option:selected').remove();
if(a != ''){
var b = $('#demo').append('<tr>
<td><input type="checkbox" onclick="checkboxClick(this)" id="ck_'+idCounter+'"/></td>
<td class="newLine">'+a+'</td>
</tr>
');
idCounter++;
}
});
});----------------------
<select id="ddlList">
<option value="0">None</option>
<option value="1">ASP.NET</option>
<option value="2">C#</option>
<option value="3">VB.NET</option>
<option value="4">HTML</option>
<option value="5">jQuery</option>
</select>
<table id="demo">
<tbody>
<tr>
<td></td>
</tr>
</tbody>
</table>-
This discussion was modified 9 years, 8 months ago by
Satyakam.
-
This discussion was modified 9 years, 8 months ago by
Satyakam.
-
This discussion was modified 9 years, 8 months ago by
Satyakam.
-
This discussion was modified 9 years, 8 months ago by
Forcetalks.
-
This discussion was modified 9 years, 8 months ago by
Forcetalks.
-
This discussion was modified 9 years, 8 months ago by
Forcetalks.
-
This discussion was modified 9 years, 8 months ago by
Forcetalks.
-
This discussion was modified 9 years, 8 months ago by
Forcetalks.
-
This discussion was modified 9 years, 8 months ago by
Forcetalks.
-
This discussion was modified 9 years, 8 months ago by
Forcetalks.
-
This discussion was modified 9 years, 8 months ago by
Forcetalks.
-
This discussion was modified 8 years, 1 month ago by
Forcetalks.
-
This discussion was modified 9 years, 8 months ago by
Log In to reply.
Popular Salesforce Blogs
Tips On How To Choose The Best Among The Salesforce Consulting Companies
Do you wish to deliver unparalleled customer services which can constantly increase your business bottom line? This is one thing that you can achieve only…
5 Ways- Salesforce Can Improve Your Customer Experience
At AwsQuality, we recognize how important the customer experience is to determining a company's success. Offering tailored Salesforce solutions that enable small and medium-sized businesses…
5 Productivity Tips by Salesforce System Administrators
Salesforce is a highly transformative platform when used correctly. It has all the tools you need to build and optimize processes. But achieving productivity on…
Popular Salesforce Videos
What is Salesforce? Career Opportunities and Job Roles in Salesforce!
This video deals with the most important aspect of Salesforce. You'll learn the following things from this video:- 1. What is Salesforce? 2. What business…
How to Reference Custom Metadata Types to Optimize Salesforce Account Records Using Salesforce Flow
Salesforce Account Region Allocation using Custom Metadata Types and Salesforce Flow This video walks through an example of how you can reference Custom metadata Types…
How Can Salesforce Marketing Cloud Help You Grow Your Business Exponentially?
Salesforce Marketing Cloud can help you take your marketing to the next level by providing an all-in-one platform that helps you strategize across multiple channels.…