Inline Form PHP?
I'm designing an e-commerce site where I have no access to the server-side code at all. It's an off the shelf thing. Anyway, I despise forms with labels. They're the ugliest things on the planet.
I want form values which delete onfocus and reappear onblu开发者_如何学运维r etc. However, due to having no access to the PHP, I can't validate the form so it won't send when "Email Address" is typed in etc.
Is there any way around this without access to the PHP?
You can also do it with CSS+Javascript
Position the Label over the textBox in JS so that if JS is disabled, the label will be somewhere else and hide it onFocus. This way your textBox are always empty by default.
You should also do form validation in JS.
If you really have no access to the server, javascript is pretty much your only answer. You could get really clever and have a proxy or something that intercepts traffic and re-writes the webpage, but that would require access to the network of anyone who will be using this site.
The javascript solution will require the client to take some action (i.e. a greasemonkey script they have to install).
If you want form values appear on onfocus event etc. it's ONLY possible throught javascript and has nothing to do with server side code.
If you want form validation, then this MUST be done on server side (PHP) and SHOULD be done in client side (javascript), for better user experience.
And what do you mean that you don't have access to source files? How can you modify even the client side then (other than for yourself)?
精彩评论