Hi Guys, The Site: QuickProxy.net If you go to "Submit Proxy" and Click on "Order" for the "Quick Proxy FREE Listing", some input boxes will come up.. My Question: Is there any way to force any input in the "domain" box will have to be in lower case and MUST start with http://www. ? Thanks in advance for the helps..
Force lower case: <input type="text" style="text-transform:lowercase" value=""/> Code (markup): Force lower case and starts with "http://www.": <input type="text" style="text-transform:lowercase" value="http://www."/> Code (markup): JavaScript for domain validation, check this URL: http://bassistance.de/jquery-plugins/jquery-plugin-validation/ Code (markup):
Since the first two thing myst posted are CSS (the style="" stuff) you can throw that into your CSS sheet. For the last one, know that people like me will slip through. I don't let strange sites run JS on my machine (NoScript is ever popular, esp with the clickjacking thing getting more media attention : ), and usually since that JS validation never runs, but your back-end still uses the submit, the form will get submitted, without the checking. So the back-end really ought to be doing the checking (via PHP script, and no, I can't tell you how to do that, I don't PHP : ) for maximum safety. You could possibly also use either back-end or JS front-end filtering to check for the http part, and add it if it's missing. What you've got now just has http stuff in the input. The user is still able to delete that and type his/her own input in there and submit. Users with browsers who automatically highlight inputs who receive the focus would then want to paste something they've copied, which will automatically replace your value. Your script in the back will also need to be able to replace the hard-coded HTML value with the one the user wrote in. It might already do that, but test to be sure. Try typing "scooby dooby" in there and then check if the information you get back says "scooby dooby", "http://www.scooby dooby" or "http://www."
with the CSS (Value="http://www."), is there a possibility to use that under Style="" instead of Value=""? Thanks
Ah no, that part isn't CSS. *edit though I wonder if the CSS property of "content" could add that... I don't think so though. input { content: "http://www"; } you could try it, though know that it won't work in IE6 or some other older browsers... and actually, having never done it myself, I don't know that it works at all. You could try it and see. The style="stuff here" is CSS. -ish. It was likely written that way because it was an example for you, but inline styles are frowned upon on real code : ) The "value" attribute is an HTML thing, which form controls can have. It's required for radio buttons and checkboxes (otherwise, the user agent (browser usually) isn't required to make those "successful" form controls... so while value-less radios and checks might work, you have no guarantee). It's an optional thing for everyone else (except textareas, unless they're read-only or something). Some people also use Javascript to add a value in (usually you see this in search boxes or login boxes, where the instructions ("type in your search terms" or "username") are sitting in the inputs (loaded by the script when done well instead of statically being in the HTML), and then that same Javascript removes them when the user puts focus there (so they don't have to manually remove/delete the temporary instruction text before typing)). People who have the values in the HTML and then use Javascript to remove the text on :focus are doing it wrong, since then those of use without Javascript have to remove the text manually, and you know, users are lazy. Your back end (whoever is actually processing this form) is the one who takes what users write and sets it as the value (in the place (often a database) where you are storing these values you want from the users). If you have a "value" attribute like in myst's example above, and the user doesn't change that, then that will get submitted just as if the user had typed it in. Usually a Good Form has a lot of "filtering" in that back end, so that you control what user input is allowed to reach your database/email/whatever. Since you said you don't know PHP, you can't do this yourself without going ahead and learning that language (no light task). So the suggestions here are kinda "the best you can do for now" but I just wanted you to know they are not Best Practices, just your Current Working Answer. Filters are awesome, because one of the rules in data processing and programming are Never Trust the User and Rule # 2 is Never Trust the User and Rule # 3 is Never Trust the User etc.... when users are allowed to input stuff, that data is called "tainted" until you can "filter" it, or verify it.
@Stomme poes So we have totally different thoughts about form validation. Client side validation is good for usability, you don't need to ask the server and wait for an answer. However, server side validation will also work if scripts don't work on client side. They don't conflict at all. Anyway, I agree that interaction brings danger, as well as scripts.
My boss has an Erickson mobile phone. He loves looking at his OneStat statistics for our web sites. His phone is less than 2 years old. But because it does not support scripts at all (and if it did, it would be draining its battery very quickly as scripts tend to do), so he cannot even log in on the site. The site is broken. They likely paid someone a whole lotta money to build a broken site. Being the hippy I am, I believe the Internets should be free, and the information on it fairly free, and available to all, regardless of user agent. Those who support images, scripts, or css get a better experience than those who don't, but unless the site is a web application (as opposed to just a site), I believe functionality is king. I do mean for sites geared to the general public, not sites built for an intranet of a company who could be asked to sign a contract insisting that it have technology X. Pretty much the same reason I don't believe in coding to one particular browser, or one particular OS, or one particular plug-in owned by a company who can (and has) decide to change its standards on a whim (Flash, I'm looking at you). Unless I'm making a specialty site, where such things obviously make sense. <bad russian accent>UNITE, COMRADES! THE REVOLUTION OF FREEDOM BEGINS!</bad russian accent> <hippy>Like, yeah, man, the innernets, they should be like, free, and stuff. As in like speech, dude.</hippy>
I understand, and agree. Core function should work well without any scripts. That means when I disable scripts, it doesn't affect anything, but if I enable scripts, I get icing on the cake. There are still blind people surfing the web, they shouldn't be forgotten.
Though what's nice is that JAWS in its current version (10) is getting pretty good at dealing with JS that changes the state of the page without a refresh. It's still got a ways to go but they're getting there. I assume it's going about the same in Window-Eyes, I dunno, don't have that one. I know someone who manages to deal with drag and drop. I really have no idea how, but he can do it (though often with hits and misses).