javascript - Laravel: Pass Div contents to Form Autocomplete -


i have used http://complete-ly.appspot.com/ create autocomplete text field in laravel form

<div class="form-group"> <div id='genre' style='border:1px solid #999;'></div> <script> var auto = completely(document.getelementbyid('genre'), {     fontsize : '14px',     fontfamily : 'arial',     color:'#933', }); auto.options = ['action','biography','drama']; auto.repaint();  settimeout(function() { auto.input.focus(); },0); </script> {{ form::label('genre', trans('main.genre')) }} {{ form::textarea('genre', input::old('genre'), array('class' => 'form-control', 'rows'     => 2)) }} 

i pass contents div id='genre' form::textarea('genre') may submitted when form gets submitted. unsure how this.

thanks help.

assuming have jquery here (question tagged jquery), can use submit handler on form, gets contents of div id genre (would suggest renaming either div or textarea avoid confusion), , puts contents in textarea name attribute of genre. need replace form_id id of form.

$('#form_id').submit(function() {     var genre = $('#genre').html();     $('textarea[name="genre"]').html(genre);     return; }); 

Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -