Validate ID number in JavaScript

You should always do your validation on the Server side first, so if the user has Javascript turned off, the data is still validated. You can then add client side validation in later to improve the users experience. Even better, use the same library to do both, setup the rules in your server side language, and then generate the Javascript validation from that.
 
You should always do your validation on the Server side first, so if the user has Javascript turned off, the data is still validated. You can then add client side validation in later to improve the users experience. Even better, use the same library to do both, setup the rules in your server side language, and then generate the Javascript validation from that.
And I was told that this was incorrect in my similar suggestion above.

Make a static helper in business layer that validates the ID and then reuse the API as a function higher up with EL.
 
W3C Standards - nuff said

Not everyone runs Java or has Java installed to run it. And having someone require Java just to be able to visit a website is a bit retarded. HTML/CSS and JavaScript. That's it. Chrome rewrote the entire JavaScript rendering engine making it 10x faster (if not more) than normal engines we currently know. AJAX = JavaScript. jQuery = JavaScript (that makes manipulating the DOM so much easier on the client side)

Why would I want an application that needs to call the server every click the user makes? Let me guess, you're the one responsible for the historical computicket system? I have several people here agreeing with me. Together we have over 30 years of experience as web developers, with new and old technologies.... yet you spew this uninformed bull**** in these forums? Eish my bru.... Eish...

Ah yes noobie. Did u even know that you can configure java webstart to auto install JRE on client machine with client permission Even better the exact JRE that the system was tested on? There is no way i am buying that CSS or even HTML are a requirement for a web application anymore because of java webstart and the two are so far from application development that MANY dont even see them as coding. I will laugh at the first adobe cs4 designer who tells me he knows how to make a web application by knowing css and html. You are inot in the know here and need to read this before spreading such lies: http://java.sun.com/developer/technicalArticles/WebServices/JWS_2/JWS_White_Paper.pdf Trust you to think that Sun would not think about the JRE requirement. Now to get back to the point: Is there really a reaosn why javascript is the future when clearly in some cases it my be profitable for a Swing developer to be able to deploy his application without creating an extra view or multiple views that may be required with servlets and jsp? Sounds like a lot of work that can be avoided and therefore costs too. Yes not everyone knows Swing, but my point is that not everyone knows html, jsp, servlets, css and straight forward everything. It is ludicrous to call a technology the future when there are many current technologies that can be used just as well and be approvedon too. The only reason why google is such a fan of java as seen by chrome and androids close integration with java is because Joshua Bloch is one of thier lead developers and most of us know he it the main architect behind MANY of the JSE 5 and 6 improvements like generics etc.

java webstart is a technology that has mostly replaced applets which are far more secure than and webpage and hence have been used in favor web applications by many online banks for logging in etc.
 
Last edited:
Ah yes noobie. Did u even know that you can configure java webstart to auto install JRE on client machine with client permission Even better the exact JRE that the system was tested on? There is no way i am buying that CSS or even HTML are a requirement for a web application anymore because of java webstart and the two are so far from application development that MANY dont even see them as coding. I will laugh at the first adobe cs4 designer who tells me he knows how to make a web application by knowing css and html. You are inot in the know here and need to read this before spreading such lies: http://java.sun.com/developer/technicalArticles/WebServices/JWS_2/JWS_White_Paper.pdf

Srsly?

You are now confusing an application with a web application. A complete Flash applet, built and distributed through a download link does not qualify as a web application. The fact that the application can be downloaded and "seamlessly integrated" with the user's desktop shows that it has more in common with a desktop application than a web application. Eliminating the need for a web browser and client / server communication essentially removes the word "web" from "web application", which gives you - yup, you guessed it - an application.

JVS is a method for starting an application over the web, hence "JAVA WEB START". A proper web application doesn't necessitate the client to install any sort of plugin / virtual machine / language interpreter to interact with it.

EDIT: Last point - the URL to that white paper reveals a teensy-little hint as to what that technology you're refering to actuall is: web services. A web service and a web application a two totally different things. You can build and utilize web services without ever even touching a web application and, subsequently, writing a single line of HTML or CSS.
 
Last edited:
Srsly?

You can build and utilize web services without ever even touching a web application and, subsequently, writing a single line of HTML or CSS.
As can you without using a single servlet or JSP or javascript so there is nothing that indicates to me that these technologies are the "future as someone put it." CSS has nothing to offer a web application developer who really usually does not care about layout and leaves it to a designer who will make the page look awesome. I am not going to start calling myself a designer just because of limited css knowledge and would expect that most designers don't call themselves application developers.
 
As can you without using a single servlet or JSP or javascript so there is nothing that indicates to me that these technologies are the "future as someone put it." CSS has nothing to offer a web application developer who really usually does not care about layout and leaves it to a designer who will make the page look awesome. I am not going to start calling myself a designer just because of limited css knowledge and would expect that most designers don't call themselves application developers.

The problem comes in here: A decent web application developer should know what well-formatted, standards compliant HTML looks like, because the application that he/she develops is serving HTML to the client. On top of that, he/she should know what CSS classes to apply to the elements (if applicable) to get the final results looking sparkling and colourful to the user. HTML and CSS are without a doubt a prerequesite to web development. I highly doubt that any web developer worth his/her salt would disagree with me.

NOTE: The word web appears before every instance of application in my post. I am not referring to a normal application / back-end developer!
 
The problem comes in here: A decent web application developer should know what well-formatted, standards compliant HTML looks like, because the application that he/she develops is serving HTML to the client. On top of that, he/she should know what CSS classes to apply to the elements (if applicable) to get the final results looking sparkling and colourful to the user. HTML and CSS are without a doubt a prerequesite to web development. I highly doubt that any web developer worth his/her salt would disagree with me.

NOTE: The word web appears before every instance of application in my post. I am not referring to a normal application / back-end developer!
You see thats the problem. Why should a web application developer care about colour and layout when this seems to be what the adobe dude is gonna do anyway :P
 
You see thats the problem. Why should a web application developer care about colour and layout when this seems to be what the adobe dude is gonna do anyway :P
although that may be the case, that not an excuse to ignore the core fundamentals of the web HTML and CSS (imo). dude catch a wakeup
 
You see thats the problem. Why should a web application developer care about colour and layout when this seems to be what the adobe dude is gonna do anyway :P

The "adobe dude" will do the colour and layout, but he is dependent on some form of document structure, formatted in HTML and conforming to the CSS that he "designed" to be pushed through to the client. That's where your knowledge, as web application developer, should allow for creating said document in standards-compliant HTML, referencing the correct CSS classes (where applicable).
 
I think you are smoking meth. Fact: NOT EVERYONE knows CSS or even HTML. CSS + HTML are tools for web design and do not fall into the category of tools that are required to develop web applications anymore.

I posted this on our company's yammer portal as a quote of the day - dude this sparked a worthy discussion...

In conclusion @Yucca you are smoking meth..and if not, you should be :p
 
And FYI. Even though validation (on some level) should be done server side, those that do not have JavaScript enabled are like the people who'll go to Table Mountain blindfolded. Yes, they're "experiencing the mountain" but they sure as hell not getting the full experience possible. And unlike BLIND people, you have a choice to switch JavaScript on or not. Doing client-side checking before you do server-side checking is important. This not only saves a round-trip (and unnecessary processes, especially checking for something like a valid email for example) to the server, it saves on bandwidth and CPU. Sure, you can throw hardware at your slow-assed web application. But if you don't optimize your web app it will be a costly venture.

As for Yucca, proving my point that offended people will die before they admit they're wrong, even though Java Web Start is able to install itself with client permission, it doesn't mean that it's the best, quickest or most-standard compliant solution out there.

Now except for someone agreeing with you (to some level) that there should be some form of validation server side as well, he wasn't against the idea that JavaScript should be doing some validation as well. Any web application developer should know that one specific technology isn't the be-all and end-all of everything. That's why you get degraded (?) methods of implementing ajax (or using hijax). This enhances the users perception of how quick your web app is as suppose to how slow it is because of all the server-roundtrip calls you need to make to do something as simple as validating an ID number (forgetting the fact that the algorithm gets ignored by government)

For someone who says that HTML, CSS and JavaScript isn't used anymore or that JVS is the future, you sound like someone who went to study Java, got out of your Java course (like a race horse who can't see anything except what is in front of him) and proceeded to go into your little world/job with only that knowledge and how "awesome" it is and how "everyone" should be using it.

I've been there, when I still had ****all experience. So n00b. You can see, several people telling you to "wake up" and catch the hint to STFU because you clearly don't know what you're talking about.

What's my score now boys? I should be on a killing spree by now?
 
Quake is better than UT...

/very off-topic:

Anyone here on Quake Live? :D

EDIT: I just realized that this thread has officially died.
 
hey, who's dissing me about regex?
okay, that cartoon was funny. ha, hardy ha.

anyways, to the point, i'm with farlig and acid on this one - that's probably because we work for similar clients.
saas delivered via the browser using standards compliant code is the mass delivery gui platform of the future imo.
i have yet to see google deploying a java self-install via web on my machine and can't forsee it happening anytime soon.

and any developer who thinks that a designer is going to do all their client-side and server-side html code for them either doesn't produce graphics rich sites or is going to be very disappointed very soon.

@farlig - yes i'm on QL, but haven't played for a while.
 
Last edited:
AcidRaZor, when I was saying you should write validation on the server side first, I was thinking more in terms of data integrity and security. Most people have javascript on, and if they choose to turn it off, they are missing out. However one reason for turning javascript off is to test a sites security or screw with the database, or spambots etc. For this reason any validation for security or business logic, should be done on the server side as well. If I wanted to register with a fake ID number, I could turn Javascript off and my entry would still be stored. I agree with you that client side validation takes load off the servers and improves the responsiveness and user experience.

I definately don't agree with Yucca, any decent web developer needs to know how to write standards compliant HTML & CSS.
 
..web developer needs to know how to write standards compliant HTML & CSS.

And do yourself a favour, start working strict.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
AcidRaZor, when I was saying you should write validation on the server side first, I was thinking more in terms of data integrity and security. Most people have javascript on, and if they choose to turn it off, they are missing out. However one reason for turning javascript off is to test a sites security or screw with the database, or spambots etc. For this reason any validation for security or business logic, should be done on the server side as well. If I wanted to register with a fake ID number, I could turn Javascript off and my entry would still be stored. I agree with you that client side validation takes load off the servers and improves the responsiveness and user experience.

I definately don't agree with Yucca, any decent web developer needs to know how to write standards compliant HTML & CSS.

True, and if you read my post I said nothing is a "one size fits all" scenario. You'll use a combination of client and server side code to maintain data integrity. However, if you've EVER done programming for normal users (and I mean people who barely know how to switch a PC on, but they have to have one for some reason). You will know that it's impossible to keep data integrity, even if you client/server/jahova and validate the crap out of the piece of data.
 
Numeric validation using Javascript

Basicallly When we trying to validate a form some time we need numeric validation for textbox.

We can validate textbox by onkeypress event of the control By checking whether the keycode of the key pressed as the user types falls within the range of the number keys 48-57(i.e 0-9 and '.') ,if not belong to that range it will return false then it will disable the keypress action

Eliza
 
Basicallly When we trying to validate a form some time we need numeric validation for textbox.

We can validate textbox by onkeypress event of the control By checking whether the keycode of the key pressed as the user types falls within the range of the number keys 48-57(i.e 0-9 and '.') ,if not belong to that range it will return false then it will disable the keypress action

Eliza

I'm guessing this person didn't bother to read the whole thread... Does this count as "RAS", having 2 links to his/her site in the same post (post+sig)?
 
Top
Sign up to the MyBroadband newsletter
X