-
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
An Introduction to Salesforce Force.com Migration Tool (ANT)
Let’s understand Metadata as: Data which give information about other Data. Metadata sums up essential data about information, making discovering, and working with specific examples…
How Does A Salesforce Consultant Shape Effective Business Strategy?
Salesforce has become one of the most popular business software in recent times. Using the same, several businesses have been effectively able to manage their…
No Code Salesforce and NetSuite Integration
The first cloud computing software provider is recognized to be NetSuite. You can manage your sales process more effectively with real-time access to your back…
Popular Salesforce Videos
Update Record Using Salesforce Flow | Flow Builder Series Salesforce
In this video, we will learn how to use Update Records in Salesforce Flow. Here is the timestamp for your help. ----------------- Update Records in…
GDPR & Telephony Consenting & Forgetting In Salesforce
The big noise in the market right now is GDPR, the General Data Protection Regulation. This is the new European rule for data protection which…
Salesforce Marketing Cloud - Introduction
Watch this video and learn about Salesforce Marketing Cloud. This is an introduction video. If you have any questions or doubts, please let us know…