Click here to Skip to main content
15,886,714 members
Home / Discussions / JavaScript
   

JavaScript

 
Questionjquery grid paging and textbox event Pin
fififlowertot17-Apr-11 23:03
fififlowertot17-Apr-11 23:03 
GeneralRe: jquery grid paging and textbox event Pin
Sunasara Imdadhusen5-May-11 3:58
professionalSunasara Imdadhusen5-May-11 3:58 
QuestionJquery Autocomplete Pin
fififlowertot13-Apr-11 5:51
fififlowertot13-Apr-11 5:51 
AnswerRe: Jquery Autocomplete Pin
Not Active13-Apr-11 6:12
mentorNot Active13-Apr-11 6:12 
GeneralRe: Jquery Autocomplete Pin
fififlowertot14-Apr-11 0:26
fififlowertot14-Apr-11 0:26 
GeneralRe: Jquery Autocomplete Pin
Gerben Jongerius14-Apr-11 1:14
Gerben Jongerius14-Apr-11 1:14 
GeneralRe: Jquery Autocomplete Pin
fififlowertot14-Apr-11 1:37
fififlowertot14-Apr-11 1:37 
Questionselect with same data/options Pin
Morgs Morgan7-Apr-11 22:35
Morgs Morgan7-Apr-11 22:35 
hi guys,
i have six(6) select controls all with values 1-6.

when i click submit in javascript i would like to check that a
select's value has not already been selected by the other five (5) selects.

can anyone please help me how i can do this, i have tried logic after logic
and yet still no joy at all...please help me.

i tried:
//check template orders
var ordercntr = false;//just a control key
var partial = '';//i'm appending the selects ids to this variable on each iteration.
var orderfinal = new Array();//will add the successful values of my selects(inside my if statement)
for (l = 0; l < order.length; l++) {
    //looping through an array that contains selects ids(order)
   //select ids have the form: sel_0, sel_1, sel_2, sel_3, sel_4, sel_5 (there six selects in total)
    partial += order[l] + '~';//appending to my partial variable, the current select's id
    var d = document.getElementById(order[l]).value;//getting the value of the select
    if (partial.search(d) < 1)
       {
         //i'm searching for whether the selected value e.g. 1 has already been appended to my
         //partial variable 'partial' which at first iteration has a value of sel_0~, second iteration=sel_0~sel_1
          orderfinal[l] = d; ordercntr = true;
       }
    else
       {
          ordercntr = false; break;
       }
}


The logic works like a charm if the selected values in the selects are in the order 1-6
But fails badly if lets say the second(2) select has the value 5(or something else other than 2)

i know i have to revisit the entire logic but i have tried and now i'm asking
for help before i try forever.

I will appreciate any help.

Morgs
AnswerRe: select with same data/options Pin
Luc Pattyn8-Apr-11 1:10
sitebuilderLuc Pattyn8-Apr-11 1:10 
GeneralRe: select with same data/options Pin
Morgs Morgan8-Apr-11 3:19
Morgs Morgan8-Apr-11 3:19 
AnswerRe: select with same data/options Pin
Luc Pattyn8-Apr-11 3:31
sitebuilderLuc Pattyn8-Apr-11 3:31 
GeneralRe: select with same data/options Pin
Morgs Morgan8-Apr-11 5:26
Morgs Morgan8-Apr-11 5:26 
AnswerRe: select with same data/options Pin
sydongda10-Apr-11 22:56
sydongda10-Apr-11 22:56 
GeneralRe: select with same data/options Pin
Luc Pattyn10-Apr-11 23:01
sitebuilderLuc Pattyn10-Apr-11 23:01 
GeneralRe: select with same data/options Pin
sydongda11-Apr-11 19:48
sydongda11-Apr-11 19:48 
QuestionWhich should i include in my page??(About JQuery UI) Pin
zouleisheng6-Apr-11 21:02
zouleisheng6-Apr-11 21:02 
AnswerRe: Which should i include in my page??(About JQuery UI) Pin
Not Active7-Apr-11 2:28
mentorNot Active7-Apr-11 2:28 
AnswerRe: Which should i include in my page??(About JQuery UI) Pin
Monjurul Habib12-Apr-11 12:31
professionalMonjurul Habib12-Apr-11 12:31 
QuestionVertical slide show Pin
venu65630-Mar-11 20:49
venu65630-Mar-11 20:49 
AnswerRe: Vertical slide show Pin
preethipriya52330-Mar-11 21:26
preethipriya52330-Mar-11 21:26 
AnswerRe: Vertical slide show Pin
Morgs Morgan7-Apr-11 22:40
Morgs Morgan7-Apr-11 22:40 
AnswerRe: Vertical slide show Pin
Prasanta_Prince17-Apr-11 8:09
Prasanta_Prince17-Apr-11 8:09 
QuestionEquivalent to System.Math.Max(System.Threading.Interlocked.Increment Pin
Pierre besquent28-Mar-11 4:48
Pierre besquent28-Mar-11 4:48 
AnswerRe: Equivalent to System.Math.Max(System.Threading.Interlocked.Increment Pin
Not Active28-Mar-11 6:02
mentorNot Active28-Mar-11 6:02 
GeneralRe: Equivalent to System.Math.Max(System.Threading.Interlocked.Increment Pin
Pierre besquent28-Mar-11 23:04
Pierre besquent28-Mar-11 23:04 

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.