Guest User

Untitled

a guest
Feb 21st, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. #I have a select that I want to submit when selected, it looks like this:
  2.  
  3.  
  4. <select id="config_<%= conf.conf_name %>" name="config[<%=
  5. conf.conf_name %>]" onchange="<%=
  6. remote_function( :url => { :action => :update ,
  7. :id=>conf.id,'config[confvalue]'=>'+this[this.selectedIndex].value' })
  8. %>"><option value="0" selected>No</option><option value="1"
  9. >Yes</option><option value="0" selected>No</option><option value="3"
  10. >Maybe</option></select>
  11.  
  12.  
  13. #the poblem is that the updated value of confvalue is 'this[this.selectedIndex].value' instead of the selected value.
  14. #I also tried something like that:
  15. :with=>config[confvalue]'=>'+this[this.selectedIndex].value'
  16.  
  17.  
  18. #but in that case nothing get updated at all.
  19. #any idea what's wrong?
  20.  
  21. #thanx in advance
  22.  
  23. #Pat
Add Comment
Please, Sign In to add comment