greywire
Posts: 37
|
| Posted: 02/28/2008, 1:35 PM |
|
I want to do something like the dependant listboxes, but instead of being linked to another listbox, I want to just have a button that calls a service and that populates the listbox.
How would I do that?
_________________
--
Aric Caley
Fonality, inc |
 |
 |
wkempees
Posts: 1679
|
| Posted: 02/28/2008, 2:05 PM |
|
What would you have the button do?
Because what you describe here is not totaly clear to me.
For instance, you arrive at the form, it is in EditMode.
Some data is displayed and there is your button, now what does it hace to do?
There is also a listbox on the form, is it empty?
A listbox is always a ID, Value pair, the ID is part of your main forms dtatastructure.
So what is it filled with?
Help me help you.
Walter
_________________
Origin: NL, T:GMT+1 (Forumtime +9)
CCS3/4.01.006 PhP, MySQL .Net/InMotion(Vista/XP, XAMPP)
if you liked this info PAYPAL me: http://donate.consultair.eu
|
 |
 |
DonB
|
| Posted: 03/01/2008, 5:29 AM |
|
In jQuery:
$("#listbox").load('/somepage.php #mylistbox option');
That's assuming /somepage.php outputs a page that simply contains a listbox
(with all the desired options) whose ID is 'listoptions.' The <option> tags
are filtered out of the page content (thus discarding the header, body tags
or other 'noise') and what's left (all the option tags) are inserted in
between the <select id="mylistbox">...</select>. Whatever <option> elements
were there are now replaced with the new values returned from somepage.php
You could add a Link with the id 'loaderlink' that initiates the loading
process:
$("#loaderlink").click(
function() {
$("#listbox").load('/somepage.php #mylistbox option');
return false; // To prevent the click from being seen and processed
by the <a> tag itself.
}
);
See this for further details: http://docs.jquery.com/Ajax/load#urldatacallback
--
DonB
"greywire" <greywire@forum.codecharge> wrote in message
news:247c72908b5119@news.codecharge.com...
>I want to do something like the dependant listboxes, but instead of being
>linked
> to another listbox, I want to just have a button that calls a service and
> that
> populates the listbox.
>
> How would I do that?
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
|