1

how to change the text "no file chosen" in this below image![][1] .

how to change the "no file chosen" text in this image Please help to me. thanks & regards chakri

9
  • possible duplicate of I don't want to see 'no file chosen' for a file input field Commented Sep 12, 2013 at 9:48
  • @AdrianWragg OP wants to change the text not remove it. Commented Sep 12, 2013 at 9:48
  • @Mr_Green, Erich Douglass' answer does apply, though. Commented Sep 12, 2013 at 9:51
  • @Mr_Green At least one answer to that question answers this one directly. Commented Sep 12, 2013 at 9:51
  • 1
    Also - if you're asking a question where an image is involved, it's worthwhile also cropping out the whitespace a bit. Commented Sep 12, 2013 at 9:57

1 Answer 1

4

I have used CSS to hide the default text and used a label to show the new text. Have a look- http://jsfiddle.net/ZDgRG/

Choose file
input[type=file]{
    width:90px;
    color:transparent;
}

window.pressed = function(){
    var a = document.getElementById('aa');
    if(a.value == "")
    {
        fileLabel.innerHTML = "Choose file";
    }
    else
    {
        var theSplit = a.value.split('\\');
        fileLabel.innerHTML = theSplit[theSplit.length-1];
    }
};
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.