Drop_down and some_function() - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Drop_down and some_function() (/showthread.php?tid=34531) |
Drop_down and some_function() - El Forum - 10-02-2010 [eluser]phpuser[/eluser] Hello, I'm using the following code to show a dropdown into a form : Code: $js = 'id="status" onChange="some_function();" class="" style="width:90px"'; But I don't know where to put the some_function() method in order to get the selected index into the dropdown and update my database automatically when the dropdown has been changed. Anyone can help me ? Thanks ! Joseph Drop_down and some_function() - El Forum - 10-04-2010 [eluser]phpuser[/eluser] Anyone knows where to find a good example which uses the OnChange="some_function()" parameter of the drop_down object ? Drop_down and some_function() - El Forum - 10-04-2010 [eluser]OlegasD[/eluser] in the view i use [removed] function textCounter(field,cntfield,maxlimit) { if (field.value.length > maxlimit) // if too long...trim it! field.value = field.value.substring(0, maxlimit); // otherwise, update 'characters left' counter else cntfield.value = maxlimit - field.value.length; } // End --> [removed] $js_message = 'onKeyDown="textCounter(document.myMessage.message,document.myMessage.remLen1,'.$max_message_chars.')" onKeyUp="textCounter(document.myMessage.message,document.myMessage.remLen1,'.$max_message_chars.')"'; <?php echo form_textarea($message,'', $js_message)?> It's not about dropdown, but you should get the idea |