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

    Join Date
    Jun 2013
    Posts
    1
    Rep Power
    0
    <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
    Location
    USA (verifiably)
    Posts
    20,128
    Rep Power
    4304
    *** 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.

    Check out my blog. | Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Common CSS Mistakes | Common JS Mistakes

    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
    Posts
    204
    Rep Power
    3
    You can use jquery to get the variable.

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

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

IMN logo majestic logo threadwatch logo seochat tools logo