Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Валидация на hidden-полях #224

Open
Realetive opened this issue Aug 2, 2017 · 4 comments
Open

Валидация на hidden-полях #224

Realetive opened this issue Aug 2, 2017 · 4 comments

Comments

@Realetive
Copy link

Валидация пытается отработать на form-fields_type_hidden, что вызывает ошибку.

@awinogradov
Copy link
Member

Сложно что-то ответить) Давай пример

@Realetive
Copy link
Author

@awinogradov, вот так, например, уже не работает.

{
  block: 'form',
  mods: {
    'has-validation': true,
    message: 'popup'
  },
  method: 'POST',
  action: 'https://echo.htmlacademy.ru/',
  content: [
    {
      elem: 'content',
      content: [
        {
          block: 'form-field',
          mods: { type: 'hidden' },
          name: '_csrf',
          id: '_csrf',
          val: 'mySecretCSRF'
        },
        {
          block: 'form-field',
          mods: {
            type: 'input',
            required: true,
            message: 'popup'
          },
          directions : ['top-left'],
          js: {
            required: {
              message : 'Super required input!'
            }
          },
          name: 'email',
          content: [
            {
              elem: 'control',
              content: [
                {
                  block: 'input',
                  name: 'email',
                  placeholder: 'Email address',
                }
              ]
            }
          ]
        }
      ]
    },
    {
      elem: 'footer',
      content: [
        {
          block: 'button',
          mods: {
            type: 'submit'
          },
          text: 'Submit'
        }
      ]
    }
  ]
}

@awinogradov
Copy link
Member

А ошибочки там какие? Чет я не вижу тут признаков валидации на скрытых полях.

@Realetive
Copy link
Author

@awinogradov а никаких. В лог ничего не валится. Пробовал дебажить — в промис validate() формы возвращается null, если встречает hidden-поле.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants