Skip to content

Uncaught TypeError: Cannot read property 'getTitle' of undefined #3

@othaimeen

Description

@othaimeen

That's the form I have:

<%= form_for @store, :url => stores_path, :html => { :multipart => true, :id => "tooltipContainerForm"} , remote: true do |f| %>

<%= f.label :name %><%= f.text_field :name, placeholder: 'Store Name', class: 'form-control', autofocus: true %>

in html it turns to:

< input autofocus="autofocus" class="form-control" id="store_name" name="store[name]" placeholder="Store Name" type="text" data-bv-field="store[name]" >

so in the script when I use

fields: {
"store[name]": {
validators: {
notEmpty: {
message: 'The first name is required and can not be empty'

I get this error on the browser console:

Uncaught TypeError: Cannot read property 'getTitle' of undefined

I tried to change the script to

            store[name]: {
                validators: {
                    notEmpty: {
                        message: 'The first name is required and can not be empty'

I got this on the console:

Uncaught SyntaxError: Unexpected token [

I'm not sure how to fix this. Tried to change name html attribute for the text_field but couldn't.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions