Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: error on 'success:false' form return

  1. #1

    Default error on 'success:false' form return

    Hello,

    I've got a problem with my extjs form :

    When I send the form, if my php file return "success: false", extjs doesn't display the error window with the message, and I get a javascript error :
    Code:
    missing ) in parenthetical
    </pre>{success: false, errors: [{id:'piece_jointe', msg:'my message...
    If my form is well filled, (sorry for my bad english) I've got the confirmation window, the redirection, and everything is well !

    So : here is my extjs button code...

    ( I'm working with smarty templates, so all the '{' are replaced by '{ldelim}', and the '}' by '{rdelim}' )
    [html]
    var frm2Add = new Ext.form.FormPanel
    (
    {ldelim}
    autoHeight: true,
    url:'/sts/dev-l-i-p-fr/e.php',
    defaultType: 'textfield',
    fileUpload:true,

    items: [
    // (...)
    ],

    buttons: [{ldelim}
    text: 'Envoyer',
    formBind: true,
    baseCls: 'chpgroup',
    // Function that fires when user clicks the button
    handler:function(){ldelim}
    frm2Add.getForm().submit
    (
    {ldelim}
    method:'GET',
    reset : false,
    success:function(){ldelim}
    Ext.Msg.alert('Status', 'Votre CV a bien

  2. #2

    Default

    What does the actual json output from the php script look like? (copy from the firebug console)

  3. #3

    Default

    I don't know whert to find the json output y'oure talking about, json is written nowhere...

    But in forebug, the html > net > response indicates "loading..."

    is this the information you wanted ?

  4. #4
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246

    Default

    Your JSON data isn't valid.

    Try running the following JSON through jslint.com.
    [CODE]{success: false, errors: {msg:'Le message n'a pas pu

  5. #5

    Default

    thanks, I changed it.
    But the problem is still here... I tried to delete the text, leaving only {success:true} (or false) but I still get the same type of error :
    Code:
    missing ) in parenthetical
    </pre>{success:false})
    I'm pretty shure it's an really ***** error ! Could you tell me alll the stupid things that can make a bug ?

    I checked my "{}", "()". they seems to be all by pairs and at the good place.

    ... something else ?

  6. #6
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246

    Default

    Run the data that is actually returned from the server (use the Net tab in Firebug) through JSLint.

  7. #7

    Default

    the response is : "Loading..."

  8. #8
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246

    Default

    That would mean that your server doesn't return anything (which isn't true, because you get a decoding error).

    Are you sure you used Firebug correctly?

  9. #9

    Default

    I don't know...
    I launch my page in firefox, I write into the form fields, I click submit ; and then I can see that I have an error in the firebug console.

    And then if I go to Net > Response, I get "loading..."

  10. #10
    Sencha Premium Member
    Join Date
    Dec 2007
    Location
    Lille, France
    Posts
    34

    Default It comes from the french language (accents....)

    Try to use UTF-8 encode and maybe it will be ok..

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •