Click here to Skip to main content
15,914,070 members
Home / Discussions / JavaScript
   

JavaScript

 
AnswerRe: Error in developing my first AJAX example. . . . Pin
Eddy Vluggen14-Oct-10 6:46
professionalEddy Vluggen14-Oct-10 6:46 
GeneralRe: Error in developing my first AJAX example. . . . [modified] Pin
Shantanu Gupta 133723-Oct-10 11:08
Shantanu Gupta 133723-Oct-10 11:08 
AnswerRe: Error in developing my first AJAX example. . . . Pin
moocr.com1-Nov-10 15:49
moocr.com1-Nov-10 15:49 
QuestionRetrieving data from an access database and show it to the user. Pin
gamer112711-Oct-10 3:04
gamer112711-Oct-10 3:04 
AnswerRe: Retrieving data from an access database and show it to the user. Pin
Eddy Vluggen14-Oct-10 6:45
professionalEddy Vluggen14-Oct-10 6:45 
AnswerRe: Retrieving data from an access database and show it to the user. Pin
Sanket898924-Oct-10 8:24
Sanket898924-Oct-10 8:24 
AnswerRe: Retrieving data from an access database and show it to the user. Pin
V.25-Oct-10 4:15
professionalV.25-Oct-10 4:15 
QuestionMove items up and down in listBox Pin
Member 32222648-Oct-10 4:55
Member 32222648-Oct-10 4:55 
Hi,
The below code works well without placing master pages.
ListBox-lst_Siblling
Up button:btn_Up
OnClientClick="MoveUp();return false;"

I want the same code working with master page.

<script language="javascript" type="text/javascript">
       function MoveUp() {
           var con = document.getElementById("lst_Siblling");

           var up = document.getElementById("hid_Up");
           up.value = "";
           if (con.selectedIndex >= 0) {
               alert("HAI");
               for (var count = 1; count < con.options.length; count++) {
                   if (con.options[count].selected == true) {
                       alert("INSIDE");
                       var tem = con.options[count].text;
                       con.options[count].text = con.options[count - 1].text;
                       alert(parseInt(con.options.length));

                       // up.value = parseInt(con.options[count].value) - 1;
                       up.value = parseInt(con.options.length) - 1;
                       alert(up.value);
                       if (con.options[count - 1].selected == false) {
                           con.options[count].selected = false;
                       }
                       con.options[count - 1].selected = true;
                       con.options[count - 1].text = tem;
                   }
               }
           }
           else {
               alert('Select any item');
           }

       }

       function MoveDown() {
           var con = document.getElementById("lst_Siblling");
           //var down = document.getElementById("hid_Down");
           var selvalue;
           // down.value = "";
           var up = document.getElementById("hid_Up");
           up.value = "";
           if (con.selectedIndex >= 0) {

               for (var count = con.options.length - 2; count >= 0; count--) {
                   if (con.options[count].selected == true) {
                       var tem = con.options[count].text;
                       con.options[count].text = con.options[count + 1].text;
                       selvalue = parseInt(con.options[count].value) + 1;
                       // down.value = selvalue;
                       up.value = selvalue;
                       alert(up.value);
                       if (con.options[count + 1].selected == false) {
                           con.options[count].selected = false;
                       }
                       con.options[count + 1].selected = true;
                       con.options[count + 1].text = tem;

                   }
               }
           }
           else {
               alert('Select any item');
           }
       }
   
   
   </script>


Guhananth.S
AnswerRe: Move items up and down in listBox Pin
Not Active8-Oct-10 5:27
mentorNot Active8-Oct-10 5:27 
Questionmathematics tables Pin
yumss5-Oct-10 9:05
yumss5-Oct-10 9:05 
AnswerRe: mathematics tables PinPopular
NeverHeardOfMe5-Oct-10 9:25
NeverHeardOfMe5-Oct-10 9:25 
AnswerRe: mathematics tables Pin
PavanPabolu10-Oct-10 19:22
PavanPabolu10-Oct-10 19:22 
AnswerRe: mathematics tables Pin
PavanPabolu10-Oct-10 19:24
PavanPabolu10-Oct-10 19:24 
AnswerRe: mathematics tables Pin
PavanPabolu10-Oct-10 19:25
PavanPabolu10-Oct-10 19:25 
Questionstring testing fails Pin
SummerBulb4-Oct-10 21:51
SummerBulb4-Oct-10 21:51 
AnswerRe: string testing fails Pin
NeverHeardOfMe4-Oct-10 22:41
NeverHeardOfMe4-Oct-10 22:41 
AnswerRe: string testing fails Pin
moocr.com1-Nov-10 15:55
moocr.com1-Nov-10 15:55 
Questionreloading pages from other windows Pin
Aptiva Dave4-Oct-10 10:09
Aptiva Dave4-Oct-10 10:09 
AnswerRe: reloading pages from other windows Pin
Karthik. A4-Oct-10 10:16
Karthik. A4-Oct-10 10:16 
GeneralRe: reloading pages from other windows Pin
Aptiva Dave4-Oct-10 10:19
Aptiva Dave4-Oct-10 10:19 
GeneralRe: reloading pages from other windows Pin
Karthik. A4-Oct-10 10:41
Karthik. A4-Oct-10 10:41 
AnswerRe: reloading pages from other windows Pin
Gerben Jongerius6-Oct-10 3:15
Gerben Jongerius6-Oct-10 3:15 
QuestionHTTPs Headers Pin
wenlong883-Oct-10 23:40
wenlong883-Oct-10 23:40 
AnswerRe: HTTPs Headers Pin
Richard MacCutchan4-Oct-10 0:53
mveRichard MacCutchan4-Oct-10 0:53 
QuestionHow to read the body of methods in JavaScript Pin
sainath4373-Oct-10 19:20
sainath4373-Oct-10 19:20 

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.