Jump to content

To add custom JavaScript validation for repeater items


SIERRA
 Share

Recommended Posts

Hi,

We are capturing the following using repeater items using process wire admin interface for sending Event related instant SMS
Venue
Time
Event name 

Once 'Submit' button is clicked we are replacing the above in our SMS template and are sending. Before that we would like to validate the character count of SMS content. We would like validate the character count of Venue+time+Event name.

  1. How can we do this using JavaScript.
  2. How can we insert custom .js file in ProcessWire admin side.
  3. How can we refer these repeater fields.

Please help
Thanks

 

Link to comment
Share on other sites

Why using JS and not a saveReady hook?

And maybe a hook on ProcessPageEdit::processInput(form:InputFieldWrapper) to check that fields content is valid and mark them as "error" in the form. You can also manage errors in saveReady by displaying an error Notice to user.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...