1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Rep Power
    <input type="file" id="selectedFile" style="display: none;" />
    <input type="button" value="Browse..." onclick="document.getElementById('selectedFile').click();" />

    if i run this code i m getting filedialogbox which i can select image ok upto dat its good , den how to capture selected path and stroe in a varible can any1 tel me the solution
  2. #2
  3. CSS & JS/DOM Adept
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2004
    USA (verifiably)
    Rep Power
    *** Thread split from this one. ***

    Welcome to DevShed Forums, Laxmender.

    This might be helpful: https://developer.mozilla.org/en-US/...b_applications

    P.S. When posting code in future posts, please place it between [code][/code] tags.
    If you want to use the button to add the tags, paste the code in the textarea and then select it before clicking the button (so you don't get the problematic JavaScript prompt dialog).
    Spreading knowledge, one newbie at a time.

    Learn CSS. | PHP includes | HTML Validator | CSS validator

    Remember people spend most of their time on other people's sites (so don't violate web design conventions).
  4. #3
  5. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Rep Power
    You can use jquery to get the variable.

    if you give the input field an ID of "inputfield", in jquery
    you could type

    var value = $('#inputfield').val();

IMN logo majestic logo threadwatch logo seochat tools logo