You need to pass an array to val():
<script type="text/javascript">
jQuery("#modules").val(["3","1"]);
</script>
From the jQuery docs:
Example:
<?php if(isset($_GET['tutor_id'])){?>$('#courses').val(<?=$cd[0]->courses?>)<?php }?>
WebDeveloper Programing PHP, CodeIgniter, HTML5, CSS3, JQUERY, Bootstrap & Scripting Tutorials
<script type="text/javascript">
jQuery("#modules").val(["3","1"]);
</script>
0 comments:
Post a Comment