Passing two id values through :with?

Hai frnds,

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?

my code

<%= periodically_call_remote(:url => { :action=>
“show_readings_for_station” }, :frequency => 5,
:with=>"‘district_id=’+document.getElementById(’_district_id’).value")%>

“_district_id” is the id of 2nd select box. “_state_id” is the id of 1st
select box.

Thanks,
Veena

yes but different parameters name like one is district_id and state_id

Hi,

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.

Good luck,
Nitin.

Thank you Nitin…Thank you Bala…
I got it worked…
Thank you sooooo much. This was a new learning for me…

Thanks,
Veena