Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID

Form sunbmitted by opening the filebrowser

edited September 2013 in Apps

Opening the filebrowser embedded with

<input type="text" name="image" id="image" size="40"/>
<input type="submit" id="browse" value="{"Browse"}" />
<script>
$(function () {
    $('#browse').click (function () {
        $.filebrowser ({
            title: '{"Choose an image"}',
            set_value: '#image',
            thumbs: true
        });
    });
});
</script>    

if the form passes the validation, the filebrowser closes immediately, the form is submitted and the record saved without the ability to choose an image.

Comments

  • I should correct the help pages, because you need to stop the default behaviour of the click like this:

    <input type="text" name="image" id="image" size="40"/>
    <input type="submit" id="browse" value="{"Browse"}" />
    <script>
    $(function () {
        $('#browse').click (function (e) {
            e.preventDefault ();
            $.filebrowser ({
                title: '{"Choose an image"}',
                set_value: '#image',
                thumbs: true
            });
        });
    });
    </script>
    
  • Corrected the help now too.

  • Double thanks!

Sign In or Register to comment.