-
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, 10 months ago by
Satyakam.
-
This discussion was modified 9 years, 10 months ago by
Satyakam.
-
This discussion was modified 9 years, 10 months ago by
Satyakam.
-
This discussion was modified 9 years, 9 months ago by
Forcetalks.
-
This discussion was modified 9 years, 9 months ago by
Forcetalks.
-
This discussion was modified 9 years, 9 months ago by
Forcetalks.
-
This discussion was modified 9 years, 9 months ago by
Forcetalks.
-
This discussion was modified 9 years, 9 months ago by
Forcetalks.
-
This discussion was modified 9 years, 9 months ago by
Forcetalks.
-
This discussion was modified 9 years, 9 months ago by
Forcetalks.
-
This discussion was modified 9 years, 9 months ago by
Forcetalks.
-
This discussion was modified 8 years, 2 months ago by
Forcetalks.
-
This discussion was modified 9 years, 10 months ago by
Log In to reply.
Popular Salesforce Blogs
Introducing Salesforce Starter For Indian Business
In today's competitive landscape, micro, small, and medium-sized enterprises (MSMEs) in India strive to stand out, enhance customer experiences, and drive revenue. To address these…
No Code Salesforce Strategic Integration with DocuSign
Salesforce and DocuSign recently expanded its footprint of their worldwide strategic relationship to create integrated solutions that will help clients accelerate how agreements are facilitated…
Upload Files as Attachment using Apex Salesforce
Files replaced Attachments in Salesforce. Now any type of document upload becomes part of Files/Content in Salesforce. With all the other advantages over Attachments, the…
Popular Salesforce Videos
How to setup Visual Studio Code for Salesforce ? | Link VSCode with Non Scratch Org using SFDX CLI
Hello Trailblazers, In this video, we're going to learn how we can setup vscode for Salesforce development. I am going to tell you how you…
Salesforce Consultant Career | Salesforce Career Path | Salesforce Consultant Certification
If you're interested in becoming a Salesforce consultant, one of the first things to consider is how much education you need. We've determined that 60.2%…
Benefits of Implementing Salesforce Revenue Cloud
Healthy revenue growth is a vital indicator of a firm’s success. The key aspects that majorly affect an organization’s revenue growth are sales, operations, finance,…