2
I am doing a project with dynamic forms, that is, the user (administrator) can make his own form (HTML/CSS), but when fetching the form from the database I need to check if the names (name
) of inputs
match the names of the form completed by the end user.
Example of a form stored in the database:
name: <input required name="name" type="text"><br>\r\n
nif: <input name="nif" type="text"><br>\r\n
<input type="submit" value="ENVIAR YO">
I would like to fetch the values of all attributes name
, remembering also (as it is not predictable) that both may be stored with ""
(name="email"
) or with ''
(name='email'
), the regex should cover both cases
The user writes the HTML, or just gives the name of the fields?
– Papa Charlie
Administrator inserts HTML @Papacharlie
– Miguel
Would it be something like, "name field html is :"? , it would always be relative to field or it could have "form html"?
– Guilherme Lautert
@Miguel Com regex i think you can do something like this: https://regex101.com/r/sA2sM5/1. Why don’t you use
Dom
? see: http://ideone.com/xlrXGt– stderr
Obgado @stderr, I think you should answer, both are correct, you can put both. https://regex101.com/r/sA2sM5/2
– Miguel