|
my2cents (m)
|
Apparently, there is something in your regex, otherwise you wouldn't be getting this error. I would do an alert of the value of the (assuming) text field and go from there. Perhaps you should apply trim() to the $name field first b4 stripslashes(), to remove any trailing spaces?
In general, I don't like mixing javascript with code, at least the way you are doing it. I would clean this up by doing a regex check on the javascript side, moving that code into a .js file, then of course having the php code do a 2ble-check in case the user has javascript turned off. The way you have it here, the implication is that you will have "<script>" tags printed out for each form field you have. If this is the case, not good.
Try what I have suggested in the first paragraph above and let us know if that works or not.
Thanks,
|