0

hopefully a quick question here, have not been able to find out the answer on google. Anyway I have the following File upload field.

    <div class="row">
    <?php echo CHtml::form('', 'post', array('enctype' => 'multipart/form-data')); ?>
    <?php echo $form->labelEx($model, 'doc'); ?>
    <?php echo CHtml::activeFileField($model, 'doc'); ?>
    <?php echo $form->error($model, 'doc'); ?>
</div>

The question I have is how to change the default text? On the page in question the upload field comes up with "No file chosen" beside the button when the page loads. I wish to change this text, anyone tell me how? Thanks.

Chaney
  • 455
  • 1
  • 7
  • 20

1 Answers1

1

I quick & dirty fix is this:

<?php echo CHtml::activeFileField($model, 'type',array('style'=>'width:100px;', 'onchange' => 'this.style.width = "100%";')); ?>
Nikos Tsirakis
  • 709
  • 4
  • 8
  • Hi, thanks for comment, that change the width alright but I need to change the text beside the box, not the width. Thanks. – Chaney Nov 23 '12 at 11:28
  • checkout this http://stackoverflow.com/questions/12035400/how-can-i-remove-the-no-file-chosen-tooltip-from-a-file-input-in-chrome – Nikos Tsirakis Nov 23 '12 at 11:37
  • I see what that is trying to do alright, so I take it there is no easy way to just change the text lol? – Chaney Nov 23 '12 at 11:53