Just a text variable...

function addListItem(listval) { 
        ... listval ...
}
addListItem('listval1');

> -----Original Message-----
> From: Matt Horn [mailto:[EMAIL PROTECTED] 
> Sent: 27 October 2003 15:02
> To: [EMAIL PROTECTED]
> Subject: Re: [ cf-dev ] OT Javascript -Select boxes
> 
> 
> erm
> can u show me what is in listval:?
> 
> hanks
> 
> ----- Original Message ----- 
> From: "Paul Johnston" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, October 27, 2003 4:58 PM
> Subject: RE: [ cf-dev ] OT Javascript -Select boxes
> 
> 
> > Here's some code...
> > 
> > ... Form name is "contentForm", select box name is "content".
> > 
> > ---code---
> > <script language="JavaScript">
> > function addListItem(listval) { 
//document.contentForm.content.options
> > a = document.contentForm.content.options.length;
> > document.contentForm.content.options[a] = new Option(listval);
> > return true;
> > }
> > function removeListItem(listpos) {
> > for(i = listpos - 1; i <
> > document.contentForm.content.options.length; i++) {
> > document.contentForm.content.options[i] =
> > document.contentForm.content.options[i + 1];
> > }
> > <cfif request.browser eq "IE">
> > document.contentForm.content.options.length--;
> > </cfif>
> > return true;
> > }
> > a = addListItem('listval1');
> > //alert('1');
> > a = addListItem('listval2');
> > //alert('2');
> > a = addListItem('listval3');
> > //alert('3');
> > a = addListItem('listval4');
> > //alert('4');
> > a = removeListItem(1);
> > </script>
> > ---code---
> > 
> > HTH
> > 
> > Paul
> > 
> > > -----Original Message-----
> > > From: Matt Horn [mailto:[EMAIL PROTECTED]
> > > Sent: 27 October 2003 14:52
> > > To: [EMAIL PROTECTED]
> > > Subject: [ cf-dev ] OT Javascript -Select boxes
> > > 
> > > 
> > > Hi
> > > 
> > >  I need to repopulate selectboxes from a query in a hidden frame
> > > 
> > >  I can add to a selectbox
> > > but once I have removed the old entries I cant create new ones
> > > 
> > > I cant seem to remember the new Options syntax
> > > 
> > >  anyone know it?
> > > 
> > >  thanks
> > > 
> > > 
> > > 
> > > |\--------------------/|
> > > Matt Horn
> > > Web Applications Developer
> > > Ph:+2782 424 3751
> > > W: http://www.matt-horn.org
> > > E:[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]
> 



-- 
** 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