View Full Version : preg pattern question

07-26-2007, 09:07 PM
say i have:
<input name="test1" id="test2" type="test3" />

1) not all fields are required
2) they can be in any order.

i can easily make a pattern that matches them in that order,and i can add a "?" to the end of each to make it so that they arent required. but what about order? how do i make it so that the order dosn't matter.

so that like i can have it like:
<input type="test1" name="test2" />
<input id="test1" type="test3" id="test2" />

and it will still match

07-26-2007, 09:51 PM
your attributes are screwed up check out http://www.w3schools.com/tags/tag_input.asp the name and id should be the same as in javascript, ie uses name and mozilla uses id! (I found out the hard way)

07-26-2007, 10:04 PM
dude yes i completely made that up as an example!!! i am not actually using that.
now can someone please help me?