• Resolved joncon62

    (@joncon62)


    Hi, first thank you so much for a wonderful plugin! I am trying to figure out how to add an attribute to a field, eg name=”email” to the email field so it will enable the auto prompt when clicked. Can I do this in the form editor or through the js api?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author EDGARROJAS

    (@edgarrojas)

    Hello!

    Sorry, there is no easy way to edit the html code directly, i guess you could do something like this:

    LoadedForms[0].GetFieldById(3).Instance.querySelector(‘select’).setAttribute(‘name’,’myname’)

    Have in mind though that i have not tested fully how this direct modification would affect the plugin so i am not sure if there are going to be side effects (like for example i am not sure if the name is going to remain if you hid and then show the field again).

    Could you detail me why you need to add the name direcly? are you using an extension or something that needs the name attribute to have the “email” value?

    Regards!

    Thread Starter joncon62

    (@joncon62)

    Thanks for your solution, that works and the attribute is preserved after hiding/showing the field.

    I am writing my own extension to an event manager registration form. The form doesn’t have conditional logic, which I need for my clients, so I’m using your form to add that functionality. So far it looks like it will work well.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Set a field attribute’ is closed to new replies.