1. #1
    Ext User
    Join Date
    Sep 2007
    Posts
    11
    Vote Rating
    0
    programmer@blore is on a distinguished road

      0  

    Default Reset the input type file field to blank

    Reset the input type file field to blank


    Hi,
    I am trying to submit a file (browse button), after which the field should be blank.As i have many other fields in the form I can't do reset:true.I just require the following field to be blank after form submit. Thanks in advance.
    The file field:

    uploadForm.add(
    hedit_objFile =
    new Ext.form.TextField({
    allowBlank: true,
    id:
    'file_path',

    inputType:
    'file',
    name:
    'upload_file',
    fieldLabel:
    'File',
    width:243,
    height:22,
    blankText:
    'Please choose a file'
    })
    );


  2. #2

  3. #3
    Ext User
    Join Date
    Sep 2007
    Posts
    11
    Vote Rating
    0
    programmer@blore is on a distinguished road

      0  

    Default


    Thanks for your reply.

    Sorry I forgot to mention that I am trying to set the value using
    hedit_objFile.setValue(
    '');
    but it seems that it is not being compiled at all as the value is not being resetted.

  4. #4
    Ext User
    Join Date
    Sep 2007
    Posts
    11
    Vote Rating
    0
    programmer@blore is on a distinguished road

      0  

    Default


    And one more thing is that this code works perfectly in mozilla but in IE it not resetting the file's value in the form.

  5. #5
    Ext User
    Join Date
    May 2009
    Posts
    1
    Vote Rating
    0
    KCFeng is on a distinguished road

      0  

    Default


    Quote Originally Posted by programmer@blore View Post
    And one more thing is that this code works perfectly in mozilla but in IE it not resetting the file's value in the form.
    I have got the same problem with you.
    Did you already solve this problem?

    In my work, it works perfectly in Chrome 1.0.154.59 and Mozilla Firefox 3.0.1,
    but failed in IE 7(means that setValue("") doesn't work)

    Can any one help me?

  6. #6
    Ext User ibralnet's Avatar
    Join Date
    Aug 2008
    Posts
    100
    Vote Rating
    0
    ibralnet is on a distinguished road

      0  

    Default


    Hi,
    I get the same problem, so do any body found a solution for this ????

  7. #7
    Ext User ibralnet's Avatar
    Join Date
    Aug 2008
    Posts
    100
    Vote Rating
    0
    ibralnet is on a distinguished road

      0  

    Default


    Hi all, I see that this problem is for a long time, but today I get the same, than I found this thread (I don't know if the person found or solution or not, now I created a function to deal with this problem and I want to put it here if some one get this problem again the function is commented :
    Code:
    function clearFileUpload(id){
            // get the file upload element
            fileField     = document.getElementById(id);
            // get the file upload parent element
            parentNod     = fileField.parentNode;
            // create new element
            tmpForm        = document.createElement("form");
            parentNod.replaceChild(tmpForm,fileField);
            tmpForm.appendChild(fileField);
            tmpForm.reset();
            parentNod.replaceChild(fileField,tmpForm);
    }
    all what you have to make is calling this function with your element id (I tested well and it work 100% on FF and IE)

  8. #8
    Sencha User
    Join Date
    May 2009
    Posts
    32
    Vote Rating
    0
    casic has a little shameless behaviour in the past

      0  

    Default


    yes. Work fine. Thanks .

  9. #9
    Sencha User
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    9
    Vote Rating
    0
    crashT is on a distinguished road

      0  

    Default


    it's fine many thanks

  10. #10
    Sencha User
    Join Date
    May 2011
    Posts
    17
    Vote Rating
    0
    leolox69 is on a distinguished road

      0  

    Default


    Many thanks. I've tried other suggestions, but none of them don't work for me.

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi