1

I'm using Solspace tag as a 'subject' field in conjunction with EE's native Channel Form. We have set the field to required using the rules parameter...

rules:FieldYear="required"

If the user doesn't hit enter when inputting a subject tag (or select an existing tag from the list), i.e. it doesn't get added as a tag and just sits in the field as text - the form will not submit. It's basically not counting it as a valid field, as technically there is no tag selected.

Is there any simple way to just convert that text to a tag on submission? Would be really helpful!

Thanks!

(p.s. The reason why we're using the rules parameter is it gives a lot more flexibility, as you can make a field required in a specific form rather than globally across the site)

1 Answer 1

0

Sorry, that is currently not available. If you're using the Tag Widget, you must press [Enter] between each tag. I recommend submitting this as a Feature Request under the specific add-on category. It'll also give other users the option to vote up the feature request, and help us prioritize features to add in upcoming versions of this add-on. http://support.solspace.com/support/discussions

Alternatively, instead of the Tag widget field you could simply have a textarea field with name="my_tag_field_name", and make sure each tag is on a separate line. That's essentially what the Tag widget does in the background, but in this case having a single tag in the field would submit that value with the form, and not trigger your required... requirement :)

Another idea could be to trigger some javascript before form submission, where fields with name="my_tag_field_name" are checked for any content. If the field is empty, fill the field with something then continue with the form submission.

Yet another idea would be to develop an extension which adds a value in the array of data being submitted to EE if the tag field is empty. This would have to happen before the Channel Form's validation kicks in.

1
  • No problem! Feel free to mark this answer as the main answer. :)
    – Solspace
    Apr 1, 2015 at 8:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.