Hi,

I have just tried it and I keep seeing the list in the url. It doesn't seem to submit it anywhere. I have the following form setup:

<form action="test.cfm" method="post" name="tform" onsubmit="writeList();">

<input type="hidden" name="hidden_list">

<p><select name="reOrderMe" size="5">

        <option value="1">First</option>
        <option value="2">Second</option>
        <option value="3">Third</option>
        <option value="4">Fourth</option>

</select></p>

<p><input type="button" value="up" onclick="moveEm('up','reOrderMe');"><br>
<input type="button" value="down" onclick="moveEm('down','reOrderMe');"></p>


<p><input type="submit" name="Submit" value="Submit"></p>

</form>

What have I missed? the url reads: test.cfm?hidden_list=3%2C1%2C4%2C2%2C&reOrderMe=2&Submit=Submit

How do I get this to submit?

Cheers

Dave

At 09:56 2/24/2003 +0000, you wrote:
watch the wrapping ;-)

-----Original Message-----
From: Robertson-Ravo, Neil (RX)
[mailto:[EMAIL PROTECTED]
Sent: 24 February 2003 09:56
To: '[EMAIL PROTECTED]'
Subject: RE: [ cf-dev ] select reorder > passing values


Yep,


try the script below...Basically the original script only passes the text,
so you need to pass the values as well, you also need to pass the values via
a hidden form field by triggering writeList() via an onsubmit="writeList();"

HTH

Neil





<script type="text/javascript">
        <!--

function moveEm(direction,listname) {

                if (listname == 'reOrderMe') {
                        dfr = document.forms[0].reOrderMe;
                }
                9
                boxLen = dfr.length;
                currentItem = dfr.selectedIndex;

if ((direction == 'up') && (currentItem > 0)) {

                        //reorder the text
                        selText = dfr.options[currentItem].text;
                        swpText = dfr.options[currentItem - 1].text;

                                // reorder the value
                                selValue = dfr.options[currentItem].value;
                                swpValue = dfr.options[currentItem -
1].value;

                        //reorder the text
                        dfr.options[currentItem - 1].text = selText;
                        dfr.options[currentItem].text     = swpText;

                                // reorder the value
                                dfr.options[currentItem - 1].value =
selValue;
                                dfr.options[currentItem].value    =
swpValue;

dfr.selectedIndex = currentItem - 1;

// writeList();


} else if ((direction == 'down') && (currentItem < boxLen - 1) && (currentItem != -1)) {

                        selText = dfr.options[currentItem].text;
                        swpText = dfr.options[currentItem + 1].text;

                                // reorder the value
                                selValue = dfr.options[currentItem].value;
                                swpValue = dfr.options[currentItem +
1].value;

                        //reorder the text
                        dfr.options[currentItem + 1].text = selText;
                        dfr.options[currentItem].text     = swpText;

                                //reorder the value
                                dfr.options[currentItem + 1].value =
selValue;
                                dfr.options[currentItem].value    =
swpValue;

dfr.selectedIndex = currentItem + 1;

// writeList();

} else if (currentItem == -1) {

                        // alert("An item must select before it can be
reordered.");

} else {}

}




function writeList() {


alertText = "";

for (i=0;i<boxLen;i++) {

                        // value does not work as the list is effectively
unchanged
                        alertText = alertText + dfr.options[i].value+ ",";


}


                //alert(alertText);
                document.forms[0].hidden_list.value = alertText;

}


//--> </script>









-----Original Message-----
From: Dave Phipps [mailto:[EMAIL PROTECTED]
Sent: 24 February 2003 09:52
To: [EMAIL PROTECTED]
Subject: RE: [ cf-dev ] select reorder > passing values


My starting point was this link: http://efficacy.net/experiments/reorder/


I want to be able to reorder a list and then submit these values via a form
submission to another page which then inputs the new order into the db.

Is this similar to what you have just done?

Thanks

Dave

At 08:52 2/24/2003 +0000, you wrote:
>Morning Dave,
>
>Are you using the code which I posted?
>
>N
>
>-----Original Message-----
>From: Dave Phipps [mailto:[EMAIL PROTECTED]
>Sent: 24 February 2003 07:51
>To: [EMAIL PROTECTED]
>Subject: RE: [ cf-dev ] select reorder > passing values
>
>
>Hi,
>
>I am also trying to get the select reorder to work and I am not having much
>luck.  Would you care to share the code you are using to pass the values of
>the select reorder list?
>
>Cheers
>
>Dave
>
>At 13:53 2/21/2003 +0000, you wrote:
> >fixed it....totally stupid; staring me right in the face....uurgh
> >
> >-----Original Message-----
> >From: Alex Skinner [mailto:[EMAIL PROTECTED]
> >Sent: 21 February 2003 11:48
> >To: [EMAIL PROTECTED]
> >Subject: RE: [ cf-dev ] select reorder > passing values
> >
> >
> >training at moment, will look back at my code which uses this at lunch
time
> >if you dont get an answer first
> >
> >Alex
> >
> >-----Original Message-----
> >From: Robertson-Ravo, Neil (RX)
> >[mailto:[EMAIL PROTECTED]
> >Sent: 21 February 2003 10:54
> >To: '[EMAIL PROTECTED]'
> >Subject: RE: [ cf-dev ] select reorder > passing values
> >
> >
> >anyone see why this is not behaving as expected?
> >
> >-----Original Message-----
> >From: Robertson-Ravo, Neil (RX)
> >[mailto:[EMAIL PROTECTED]
> >Sent: 21 February 2003 09:42
> >To: '[EMAIL PROTECTED]'
> >Subject: RE: [ cf-dev ] select reorder > passing values
> >
> >
> >in the end I used this one which Alex posted,
> >
> >http://efficacy.net/experiments/reorder/
> >
> >and if anyone can get this to work by passing values, it would be
>great....I
> >just can't see how at the moment?
> >
> >
> >-----Original Message-----
> >From: Robertson-Ravo, Neil (RX)
> >[mailto:[EMAIL PROTECTED]
> >Sent: 21 February 2003 09:41
> >To: '[EMAIL PROTECTED]'
> >Subject: RE: [ cf-dev ] select reorder > passing values
> >
> >
> >Nope I tried that and it only passes the existing values of the select
box
> >when it loads...I think I will have to run another function which will
>amend
> >the objects values after each up and down but I can't seem to get it
> >working...
> >
> >
> >
> >-----Original Message-----
> >From: Kola Oyedeji [mailto:[EMAIL PROTECTED]
> >Sent: 21 February 2003 09:43
> >To: [EMAIL PROTECTED]
> >Subject: RE: [ cf-dev ] select reorder > passing values
> >
> >
> >Try changing
> >
> >alertText = alertText + dfr.options[i].text+ ",";
> >
> >to
> >
> >alertText = alertText + dfr.options[i].value + ",";
> >
> >Does that work?
> >
> >KOla
> > >> -----Original Message-----
> > >> From: Robertson-Ravo, Neil (RX) [mailto:Neil.Robertson-
> > >> [EMAIL PROTECTED]
> > >> Sent: 21 February 2003 09:31
> > >> To: '[EMAIL PROTECTED]'
> > >> Subject: [ cf-dev ] select reorder > passing values
> > >>
> > >> OK, this function works when you are dealing with the select box text
> > >> entries, but not when you are dealing with the values? any ideas?  I
> >cant
> > >> seem to get it to pass the values of the select menu via a hidden
> >form
> > >> field!
> > >>
> > >>
> > >> =================================
> > >> function writeList() {
> > >>
> > >>              alertText = "";
> > >>              document.
> > >>
> > >>              for (i=0;i<boxLen;i++) {
> > >>                      alertText = alertText + dfr.options[i].text+
> >",";
> > >>
> > >>              }
> > >>
> > >>              alert(alertText);
> > >>
> > >>              // copy all the reordered values into the hidden form
> >field
> > >>              //document.forms[0].hidden_list.value = alertText;
> > >>
> > >>
> > >>      }
> > >>
>
>
>--
>** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
>
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>For human help, e-mail: [EMAIL PROTECTED]
>
>--
>** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
>
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>For human help, e-mail: [EMAIL PROTECTED]


============================================ Phipps CF Development Oxford, Oxfordshire. Telephone: +44(0)7718 896696 http://www.phipps-cf.co.uk ============================================


-- ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]


============================================
Phipps CF Development
Oxford, Oxfordshire.
Telephone: +44(0)7718 896696
http://www.phipps-cf.co.uk
============================================


-- ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]



Reply via email to