Why file inputs refresh doesn't work?
- <?php
- print "<div data-role='fieldset' id='upload'>";
- print "<input type='hidden' name='MAX_FILE_SIZE' value='500000'/>";
- // print "<div data-role='fieldcontain'>";
- // print "<label for='upload[]'>add one img:</label>";
- // print "<input type='file' name='upload[]' id='upload1'>";
- // print "</div>";
- print "<button type='button' id='addUp' name='addUp' data-inline='true'>add a file upload</button>";
- print "<button type='button' id='delUp' name='delUp' data-inline='true'>del</button>";
- print "</div>";
- ?>
my js file
- $(function(){
- $("#addUp").click(function() {
- /* Act on the event */
- $("#upload").append("<div data-role='fieldcontain'><label for='upload[]'>upload:</label><input type='file' name='upload[]' id='upload1'></div>");
- // $("#addUp").trigger('create'); // this doesn't work.no css
- $("input[type='file']").textinput("refresh"); // this doesn't work.no css
- });