javascript - "rails-backbone" gem: how to implement the simple js code using backbone js -


i having code how use using backbone.js. planning implement javascript code in rails. code below gives dropdown menu default , 1 "write own question" facility, 1 can write there own question clicking on option.

one can write own question on textbox appears below dropdown menu when clicked on "write own question" otherwise text box hidden. store string written user database or rails model.please suggest me way using backbone.js

<select onchange="checkother(this);">             <option value="select 1 question....">select 1 question...</option>             <option value="on street did grow up?">on street did grow up?</option>             <option value="what first phone number?">what first phone number?</option>             <option value="what make of first car?">what make of first car?</option>             <option value="write own question...">write own question...</option> </select> <input type="text" id="textbox1" name="textbox1" style="display:none;" /> <script type="text/javascript">  function checkother(selectbox)     {         if (selectbox.selectedindex == selectbox.options.length - 1)         {             document.getelementbyid("textbox1").style.display = "inline";          }         else         {             document.getelementbyid("textbox1").style.display = "none";             document.getelementbyid("textbox1").value = "";         }     } </script> 


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -