-
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 10 years ago by
Satyakam.
-
This discussion was modified 10 years ago by
Satyakam.
-
This discussion was modified 10 years ago by
Satyakam.
-
This discussion was modified 9 years, 11 months ago by
Forcetalks.
-
This discussion was modified 9 years, 11 months ago by
Forcetalks.
-
This discussion was modified 9 years, 11 months ago by
Forcetalks.
-
This discussion was modified 9 years, 11 months ago by
Forcetalks.
-
This discussion was modified 9 years, 11 months ago by
Forcetalks.
-
This discussion was modified 9 years, 11 months ago by
Forcetalks.
-
This discussion was modified 9 years, 11 months ago by
Forcetalks.
-
This discussion was modified 9 years, 11 months ago by
Forcetalks.
-
This discussion was modified 8 years, 4 months ago by
Forcetalks.
-
This discussion was modified 10 years ago by
Log In to reply.
Popular Salesforce Blogs
Transparency to Manufacturers with Salesforce Manufacturing Cloud
Salesforce, a CRM software company has announced Manufacturing Cloud that is a new industry-oriented product for manufacturers. Manufacturing Cloud is a part of Salesforce’s Customer 360 Platform for…
Can CRM Cut Costs In Expanding Your Business?
In this age of fierce competition, the one aspect which you can certainly not overlook is customer experience and customer expectation. The concept of customer retention comes…
New Integration Alert — CRMJetty Salesforce Portal Gets Even More Powerful
Today, business organizations do not require a CRM system as the way of maintaining a relationship with a customer. They require solutions that would facilitate…
Popular Salesforce Videos
Salesforce Training Video For Beginners - 2 | Sales Cloud Training |Salesforce Tutorial
This Salesforce Training Video will help you understand what is sales cloud in Salesforce, creating and converting leads in salesforce, creating accounts, products, opportunities and…
What are The Benefits of Salesforce Financial Services Cloud?
Business today is all about relationships. That’s nothing new. But how you go about managing and maintaining those relationships is completely different in today’s business…
Salesforce Admin 201 Training for Beginners: Different Types of Relationship in Salesforce
The Salesforce Certified Administrator program is designed for individuals who have experience as a Salesforce administrator. The program encompasses the breadth of applications, the features…