coboalvaro
Posts: 3
|
| Posted: 08/03/2005, 12:18 PM |
|
Hi guys,
I would like to know if anybody could give me any clue about "feeding a listbox dinamically". What I mean is:
I have a combobox or listbox which depends on a database table, but usually the options listed or saved in the table are not enough and have to be added by the user. How could I do that through a pop-up window?.
Does anybody could give a link where I can see an example?.
Any clue will be very appreciated.
Thanks and best regards,
Alvaro.
|
 |
 |
Damian Hupfeld
|
| Posted: 08/04/2005, 6:21 AM |
|
Something like this?
Photo Upload
Title:
Photo:
Album:
Where Album is a List box.
I put 2 grids on the same page with the NewAlbum grid first and a message
asking users not to create unneccessary albums. The Return page on teh Album
grid is the same page, as the List Box is populated when the page loads.
regards
Damian Hupfeld http://www.nexthost.com.au/services.php
"coboalvaro" <coboalvaro@forum.codecharge> wrote in message
news:542f11877e1152@news.codecharge.com...
> Hi guys,
>
> I would like to know if anybody could give me any clue about "feeding a
> listbox
> dinamically". What I mean is:
>
> I have a combobox or listbox which depends on a database table, but
> usually the
> options listed or saved in the table are not enough and have to be added
> by the
> user. How could I do that through a pop-up window?.
> Does anybody could give a link where I can see an example?.
>
> Any clue will be very appreciated.
>
> Thanks and best regards,
>
> Alvaro.
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
Alvaro Cobo
|
| Posted: 08/04/2005, 8:47 PM |
|
Thanks Damian:
I will try it and inform the list about the results.
Best regards,
Alvaro
"Damian Hupfeld" <damian.hupfeld@itng.com.au> escribió en el mensaje
news:dct4pf$ud1$1@news.codecharge.com...
> Something like this?
>
> Photo Upload
>
> Title:
> Photo:
> Album:
>
> Where Album is a List box.
>
> I put 2 grids on the same page with the NewAlbum grid first and a message
> asking users not to create unneccessary albums. The Return page on teh
Album
> grid is the same page, as the List Box is populated when the page loads.
>
> regards
> Damian Hupfeld
> http://www.nexthost.com.au/services.php
>
>
>
> "coboalvaro" <coboalvaro@forum.codecharge> wrote in message
>news:542f11877e1152@news.codecharge.com...
> > Hi guys,
> >
> > I would like to know if anybody could give me any clue about "feeding a
> > listbox
> > dinamically". What I mean is:
> >
> > I have a combobox or listbox which depends on a database table, but
> > usually the
> > options listed or saved in the table are not enough and have to be added
> > by the
> > user. How could I do that through a pop-up window?.
> > Does anybody could give a link where I can see an example?.
> >
> > Any clue will be very appreciated.
> >
> > Thanks and best regards,
> >
> > Alvaro.
> > ---------------------------------------
> > Sent from YesSoftware forum
> > http://forums.codecharge.com/
> >
>
>
|
|
|
 |
Michael Mikkelsen
|
| Posted: 08/05/2005, 12:49 PM |
|
<head>
<script>
function checkAdd(theSel){
if(theSel.selectedIndex==(theSel.options.length-1)){
newOpt=prompt("Enter new Option","")
if(newOpt>""){
theSel.options[theSel.selectedIndex].text=newOpt;
theSel.options[theSel.options.length]=new Option("Other");
}
}
}
</script>
</head>
<body>
<form>
<select onChange="checkAdd(this)">
<option>A</option>
<option>B</option>
<option>C</option>
<option>Other</option>
</select>
</form>
</body>
|
|
|
 |
Michael Mikkelsen
|
| Posted: 08/05/2005, 12:53 PM |
|
here is another one:
<head>
<title>Untitled</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
function xcats(select) {
if (select.value!= "new") return;
var catName = prompt('Please enter category name:','');
if (!catName) return;
var newOption = document.createElement("option");
newOption.value = catName;
newOption.appendChild(document.createTextNode(catName));
select.insertBefore(newOption, select.lastChild);
select.selectedIndex = select.options.length-2;
}
</script>
</head>
<body>
<form name="test">
<select name="cats" onchange="xcats(this)">
<option value="general">General</option>
<option value="community">Community</option>
<option value="new">New category</option>
</select>
</form>
</body>
|
|
|
 |
|