I hav two select boxes.1st selectbox for selecting the "state" and
the 2nd selectbox will be populated with the “districts” based on the
1st select box value.I want to show some details according to the
district selected.
I am able to do these things.But i want to get both the id of 1st and
2nd select box in the action “show_readings_for_station”.Can i pass two
ids with periodically_call_remote?
If you need to pass two values using periodically call remote,
trying :with option is a good idea. Yes, we can pass more than one
values
with it.
Have a look at this, and try to follow the same -
, :with => “‘tag_last_id=’+#{last_activity.to_i}+’&tag_name=’+’#{tag}’”
THIS ONE IF the values of _district_id and _state_id are INTEGER
“‘district_id=’+$(’_district_id’).value+’&state_id=’+$(’_state_id’).value”
THIS ONE IF the values of _district_id and _state_id are STRING
“‘district_id=’+’$(’_district_id’).value’+’&state_id=’+’$(’_state_id’).value’”
And if that doesn’t work it would be coz $(‘element_id’).value DIDN’T
WORK.
so just replace it with document.getElementById(‘element_id’).value and
it
should be working then.