By twardowski on
I need to add some new options into select form after event "change" () occurs. My web is based on Drupal 5.12.
Is jQuery the right way? Must I use AHAH? Is avaible some sample?
Thank you very much.
Twardowski
I need to add some new options into select form after event "change" () occurs. My web is based on Drupal 5.12.
Is jQuery the right way? Must I use AHAH? Is avaible some sample?
Thank you very much.
Twardowski
Comments
This can be done in jQuery
This can be done in jQuery without AHAH, generally speaking. Check out http://docs.jquery.com/Events for jQuery events and http://www.texotela.co.uk/code/jquery/select/ for select box manipulation with jQuery.
but how add data from DB
I read this before, but (I forgot to write it) I need befor get some data from DB and this data put into select form. I know how to put into select form some static data.
from DB
is there a way how to get data from DB "from" JS (is there a convenient Drupal function) code.
There is more than one way to
There is more than one way to do this. What form exactly do you want to change?
forms
I have got this form:
And I would like to change anoher form:
and I would like to add/change data (selected from DB, non static) in this form, when first form is changed.
Thank you very much!
what i tried
I tried something like this
And JavaScript code, that call this url:
if(Drupal.jsEnabled){
$(document).ready(function() {
$('select.terms-array').change(function() {
alert( "terms changed");
});*/
});
}
But everything that happened is: blank page only with this text:
{ "score": 10, "ahoj": 12 }