-
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, 7 months ago by
Satyakam.
-
This discussion was modified 10 years, 7 months ago by
Satyakam.
-
This discussion was modified 10 years, 7 months ago by
Satyakam.
-
This discussion was modified 10 years, 6 months ago by
Forcetalks.
-
This discussion was modified 10 years, 6 months ago by
Forcetalks.
-
This discussion was modified 10 years, 6 months ago by
Forcetalks.
-
This discussion was modified 10 years, 6 months ago by
Forcetalks.
-
This discussion was modified 10 years, 6 months ago by
Forcetalks.
-
This discussion was modified 10 years, 6 months ago by
Forcetalks.
-
This discussion was modified 10 years, 6 months ago by
Forcetalks.
-
This discussion was modified 10 years, 6 months ago by
Forcetalks.
-
This discussion was modified 8 years, 11 months ago by
Forcetalks.
-
This discussion was modified 10 years, 7 months ago by
Log In to reply.
Popular Salesforce Blogs
Salesforce Mobility & Security – When the user’s PIN is simply not enough
Many of us love and prefer using Salesforce and working with Salesforce data in remote locations, on mobile devices. With an ever-increasing popularity and high-speed…
Salesforce Opportunity Stages Best Practices
One of Salesforce’s numerous advantages is its ability to ensure transparent sales processes using a special tab called “Opportunities.” This tab displays a list of…
Salesforce Einstein: The Driving Force Behind Exceptional Organizational Growth
Are you tired of relying on guesswork to make critical business decisions? It's time to harness the power of AI with Salesforce Einstein. This cutting-edge…
Popular Salesforce Videos
Salesforce Deployment Using Workbench | Salesforce Workbench Tutorial
Salesforce Deployment using Workbench. In this video, the following points will be covered - 1. Introduction Get a brief introduction about the Workbench tool. 2.…
How Customers Embrace Salesforce - Literally!
Get ready to giggle ???? Couldn’t get enough of the famous Key and Peele’s video doing the rounds on social media? Check out our version…
Salesforce Development and Career Opportunities
Salesforce is the world’s #1 customer relationship management (CRM) platform. Salesforce allows sales reps to see everything about a customer in one place and provide…