Apologies if this is answered elsewhere, please point me in that direction.
I have a form field for capturing the name of a brewery, this comes via an API...
<label>Brewery</label><br>
<input class="form-control" type="text" name="breweryname" >
the API passes me a brewery name like so...
brewery_name: 'Reuben\'s Brews',
For most examples, the brewery name does not have an apostrophe. So the API brewery name shows up in the form field as expected. But as in the example above, the brewery name has an apostrophe, so the name will not show up in my form field.
I am hoping there is a non-javascript, pattern attribute solution that will let me optionally include apostrophes (or other unforeseen special characters) in the text. If not, then I'm open to javascript or other suggestions.
I see many examples of 'use pattern to exclude certain characters' or 'use pattern to force users to only use this given text pattern'. But I don't see anything that would allow for the optional inclusion of a character like an apostrophe (or any other optional inclusion of special characters).
If it seems like this is an issue beyond my form input field, I am happy to share more of my coding.
Aucun commentaire:
Enregistrer un commentaire