1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

unspecified error

Discussion in 'XenForo Development Discussions' started by Hugilore111, May 12, 2016.

  1. Hugilore111

    Hugilore111 Member

    Hello
    How to check empty INPUT
    When submitting a form
    Error occurs if you send a blank INPUT
    unspecified error
     
  2. wang

    wang Well-Known Member

    You can check it with empty() or isset() functions.
     
    Hugilore111 likes this.
  3. Hugilore111

    Hugilore111 Member

    wang

    Fatal error: Can't use method return value in write context in
     
  4. wang

    wang Well-Known Member

    Can I give you some advice sir? When you need help with coding, it would be a good thing to post the whole code, or that part of the code that you need help with. Because that would save you, and those that are helping you, a lot of time by eleminating the guess work.
     
    Hugilore111 likes this.
  5. Hugilore111

    Hugilore111 Member

    Template
    Code:
    <form action="{xen:link 'account/example'}" method="post" class="xenForm formOverlay AutoValidator">
    <dl>
    <dd>
        <input type="text" name="example" value="" dir="ltr" class="textCtrl" id="ctrl" />
    </dd>
    </dl>
    <input type="submit" value="{xen:phrase send_message}" accesskey="s" class="button primary refcl" id="SubmitButton" />
    <input type="hidden" name="_xfToken" value="{$visitor.csrf_token_page}" />
    
    </form>
    Controller
    Code:
      
    Example_Controller_Public_Index
    {
     public function actionExample()
        {
          $this->_input->filterSingle('example', XenForo_Input::STRING);
         
          //I have come to check an empty field or not?
        }
    }
    
     
  6. wang

    wang Well-Known Member

    It is not very clear to me as to what are you trying to do. Anyways, can you try this?

    Code:
    $example = $this->_input->filterSingle('example', XenForo_Input::STRING);
    
     
    Hugilore111 likes this.
  7. Hugilore111

    Hugilore111 Member

    when it is not empty all INPUT well
    otherwise when you send through the form
    inscription top unspecified error
     
  8. Nobita.Kun

    Nobita.Kun Well-Known Member

    Remove AutoValidator should work.
     
    Hugilore111 likes this.

Share This Page