Click here to Skip to main content
15,908,841 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Datagrid Pin
kirthikirthi31-Jan-07 20:10
kirthikirthi31-Jan-07 20:10 
QuestionEnhanced Dropdownlist Pin
Vsree31-Jan-07 19:00
Vsree31-Jan-07 19:00 
AnswerRe: Enhanced Dropdownlist Pin
Vasudevan Deepak Kumar31-Jan-07 19:29
Vasudevan Deepak Kumar31-Jan-07 19:29 
GeneralRe: Enhanced Dropdownlist Pin
Vsree31-Jan-07 19:39
Vsree31-Jan-07 19:39 
AnswerRe: Enhanced Dropdownlist Pin
Vsree31-Jan-07 20:16
Vsree31-Jan-07 20:16 
QuestionAdd elements from one ListBox to another ListBox Using JavaScript Pin
varshavmane31-Jan-07 18:10
varshavmane31-Jan-07 18:10 
AnswerRe: Add elements from one ListBox to another ListBox Using JavaScript Pin
Venkatesh Mookkan31-Jan-07 18:23
Venkatesh Mookkan31-Jan-07 18:23 
GeneralRe: Add elements from one ListBox to another ListBox Using JavaScript Pin
varshavmane31-Jan-07 18:56
varshavmane31-Jan-07 18:56 
Thanks for the reply sir. I got some code but its not working I am not able to track whats wrong.
<html>
<head>
<script language="JavaScript">
function f_optionMove(s_from, s_to)
{
alert(s_from);
var e_from = document.forms['test_form'].elements[s_from],e_to = document.forms['test_form'].elements[s_to];
alert(e_from);
if (!e_from)
return alert ("Error: selectbox with name '" + s_from + "' can't be found.");
if (!e_to)
return alert ("Error: selectbox with name '" + s_from + "' can't be found.");
var n_moved = 0;
for (var i = 0; i < e_from.options.length; i++)
{
if (e_from.options.selected)
{
e_to.options[e_to.options.length] = new Option(e_from.options.text, e_from.options.value);
n_moved++;
}
else if (n_moved)
e_from.options[i - n_moved] = new Option(e_from.options.text, e_from.options.value);
}
if (n_moved)
e_from.options.length = e_from.options.length - n_moved;
else
alert("You haven't selected any options");
}

function f_optionMoveAll(s_from, s_to)
{
var e_from = document.forms['test_form'].elements[s_from],e_to = document.forms['test_form'].elements[s_to];
if (!e_from)
return alert ("Error: selectbox with name '" + s_from + "' can't be found.");
if (!e_to)
return alert ("Error: selectbox with name '" + s_from + "' can't be found.");
e_to.options.length = 0;
for (var i = 0; i < e_from.options.length; i++)
e_to.options = new Option(e_from.options.text, e_from.options.value);
e_from.options.length = 0;
}

function f_selectAll (s_select)
{
var e_select = document.forms['test_form'].elements[s_select];
for (var i = 0; i < e_select.options.length; i++)
e_select.options.selected = true;
}
</script>
</head>
<body>
<form id="test_form" name="test_form" runat="server">
<table border="0" cellpadding="0" cellspacing="0" style="width: 100%">
<tr>
<td>
<select multiple name="source" style="width: 170px; height: 170px">
<option>Vishal</option>
<option>Pooja</option>
<option>Dnyandeo</option>
<option>Varsha</option>
<option>Aditi</option>
<option>Nilesh</option>
</select>
</td>
<td>
<table border="0" cellpadding="0" cellspacing="0" style="width: 100%">
<tr>
<td>
<input type="Button" style="width: 200px;" value="Add Selected &gt;&gt;" onclick="f_optionMove('source', 'destination')">
</td>
</tr>
<tr>
<td>
<input type="Button" style="width: 200px;" value="Remove Selected &lt;&lt;" onclick="f_optionMove('destination', 'source')">
</td>
</tr>
<tr>
<td>
<input type="Button" style="width: 200px;" value="Add All &gt;&gt;" onclick="f_optionMoveAll('source', 'destination')">
</td>
</tr>
<tr>
<td>
<input type="Button" style="width: 200px;" value="Remove All &lt;&lt;" onclick="f_optionMoveAll('destination', 'source')">
</td>
</tr>
<tr>
<td>
<input type="Button" style="width: 200px;" value="Select All Sources" onclick="f_selectAll('source')"></td>
</tr>
<tr>
<td>
<input type="Button" style="width: 200px;" value="Select All Destinations;" onclick="f_selectAll('destination')"></td>
</tr>
</table>
</td>
<td>
<select multiple name="destination" style="width: 170px; height: 170px">
</select>
</td>
</tr>
</table>
</form>
</body>
</html>

Please tell me where I am going wrong.


GeneralRe: Add elements from one ListBox to another ListBox Using JavaScript Pin
Venkatesh Mookkan1-Feb-07 0:15
Venkatesh Mookkan1-Feb-07 0:15 
Questiontext highlight in pdf files Pin
amrtita31-Jan-07 18:05
amrtita31-Jan-07 18:05 
QuestionWriting the contents of response object into an ExcelSheet Pin
crazy_mads31-Jan-07 16:39
crazy_mads31-Jan-07 16:39 
Questionlogin form Pin
saravanan0531-Jan-07 12:27
saravanan0531-Jan-07 12:27 
AnswerRe: login form Pin
minhpc_bk31-Jan-07 14:15
minhpc_bk31-Jan-07 14:15 
AnswerRe: login form Pin
ednrgc1-Feb-07 3:53
ednrgc1-Feb-07 3:53 
QuestionASP.net/SQL newbie Question Pin
Planker31-Jan-07 11:02
Planker31-Jan-07 11:02 
AnswerRe: ASP.net/SQL newbie Question Pin
minhpc_bk31-Jan-07 14:10
minhpc_bk31-Jan-07 14:10 
GeneralRe: ASP.net/SQL newbie Question Pin
Planker31-Jan-07 16:47
Planker31-Jan-07 16:47 
GeneralRe: ASP.net/SQL newbie Question Pin
minhpc_bk1-Feb-07 0:08
minhpc_bk1-Feb-07 0:08 
QuestionClicking on data in a GridView Pin
dptalt31-Jan-07 10:22
dptalt31-Jan-07 10:22 
AnswerRe: Clicking on data in a GridView Pin
minhpc_bk31-Jan-07 14:09
minhpc_bk31-Jan-07 14:09 
GeneralRe: Clicking on data in a GridView Pin
badgrs31-Jan-07 22:23
badgrs31-Jan-07 22:23 
Questioncurrentdate Pin
saravanan0531-Jan-07 10:20
saravanan0531-Jan-07 10:20 
AnswerRe: currentdate Pin
Guffa31-Jan-07 10:49
Guffa31-Jan-07 10:49 
GeneralRe: hi guffa Pin
saravanan0531-Jan-07 11:14
saravanan0531-Jan-07 11:14 
AnswerRe: hi guffa Pin
Guffa31-Jan-07 13:52
Guffa31-Jan-07 13:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.