I couldn’t even get an alert box to work. After a good bit of trial and error, I found the reason. I put in a line of radio button code from the www3 school’s try it and it worked. After closer inspection, I found that the original radio button had parenthesis.
The original code was
<%= radio_button_tag( :data_file, “cars”)”%>
I tried adding the onclick as
<%= radio_button_tag( :data_file, “cars”, false, onclick: “setFileType(‘Cars’);”)%>
That didn’t work. Based on the sample line of code that did work, I removed the enclosing parenthesis as follows.
<%= radio_button_tag :data_file, “cars”, false, onclick: “setFileType(‘Cars’);”%>
Now the code and developer (Me) are happy!!
- Showing the file name before committing to an upload of a CSV file in Ruby on Rails
- Rails – Pop up window with no header, footer or navigation
- CREEPY – Google Satellite view removing vehicles from roads and highways
- Validating CSV imports in Rails
- Creating pop ups in rails
- Going back two pages in Ruby on Rails
- Quick redirect to your home page in Joomla for 404 errors
- Changing the file name in the Epson Scanning software.