Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Form Questions /

UploadField return not found error


Reply


478 Views

Avatar
joanef2

Community Member, 1 Post

11 March 2014 at 8:53am

Edited: 11/03/2014 8:56am

Hi everyone!

I'm trying to deal with this problem since a week!
I create a Form (that i render with a custom template) with an UploadField
When i choose a file to be uploaded, the progress bar feel to 100% and the UploadField return 'Not Found' error
So tri to dig some little with Charles Proxy and found that SS return an [User Warning] popCurrent called on ModelAsController controller, but it wasn't at the top of the stack" error!

Didn't find any way to fix this error
I'm using SS 3.0.5

Here is my Form definition:

function RegisterForm(){
   $fields = new FieldList(
      // $photoField = new ImageUploadField('PhotoProfil', ''),
      $photoField = new UploadField('PhotoProfil', ''),
      new TextField('Pseudo'),
      new PasswordField('Password'),
      new TextField('Ville')
   );
   
   
   $validator = new RequiredFields('Pseudo', 'Password', 'BirthDay', 'Ville', 'Sexe', 'Profession', 'Pays', 'DepProv', 'chk');
   $actions = new FieldList(
      new FormAction('doInscriptionForm', "ENVOYER")
   );
   $myform = new Form($this, 'RegisterForm', $fields, $actions, $validator);
   
   return $myform->renderWith(
      '',
      'Form'
   );
}

And the custom InscriptionForm template:

<form id="register-form" class="ui_left" $FormAttributes >   
      <% if Message %>
       <p id="{$FormName}_error" class="message $MessageType">$Message</p>
      <% else %>
       <p id="{$FormName}_error" class="message $MessageType" style="display: none"></p>
      <% end_if %>
      
      <div class="register_img ui_left">
         $Fields.dataFieldByName(PhotoProfil).FieldHolder
      </div>
      
      <div id="pseudo_div" class="register_form ui_left">
         <label>Pseudo*</label>
         <input name=%26quot%3BPseudo%26quot%3B type="text" id="pseudo_input" class="register_form_input" value="" placeholder="Pseudo" />
      </div>
      <div class="clear"></div>
      
      <div class="register_form ui_left">
         <label>Créez un mot de passe</label>
         <input name=%26quot%3BPassword%26quot%3B type="text" class="register_form_input" value="" />
      </div>
      
      <div class="clear"></div>
      
      $Fields.dataFieldByName(SecurityID)
      <div class="register_form ui_left">
         <label>Ville</label>
         <input name=%26quot%3BVille%26quot%3B type="text" class="register_form_input" value="" />
      </div>
   
</form>

I also find that when i don't render the form without my custom template the UploadField work fine
Please help me find a solution