• Post Reply Bookmark Topic Watch Topic
  • New Topic

javascript mandatory for client side validations  RSS feed

 
saikrishna cinux
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello sir,

if we want to check the user input in a webpage
(ex:registering to a site involves a lot of textfields,checkboxes,list.....
so,what if , if the user in the name field enters numeric value instead of entering a string value, with this there may be problems)

so, can we make conditional stmts in bussiness logic or otherwise can we use javascript....
is javascript mandatory for client side validations???

which is the better among clintside evaluation....

sir please can u clearly explain it.....

cinux
 
Niki Nono
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
according to me client-side javascript is the fastest way that you can do validations.
other options include sending the data to the server and let the server validate it but as you can see sending it to the server and then the server will process it and then the information will return back to the client involves so many steps and consumes time as well as resources.

so you better use javascript which will do the same for you in the client itself as it is loaded during page load.
 
saikrishna cinux
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
dear niki,

i accept ur opinion.... i and i am very happpy with ur suggestion toooo.

but do every java /j2ee developer should know java script to handle client side validation's....
and moreover java script is entirely diff from java programming...
so a developers work is just programming part i think not the script part...
is'nt it Mr? if not can u justify it???


thanking u once agian ....
cinux
 
Niki Nono
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
saikrishna

if you are a web developer then how can you design a page without the use of javascript???
web development involves use of javascript to a very large extent.
if you do not know javascript you better learn it as it is a very powerful language in sense it saves you a lot of time and resources.

If you differ from my opinion please justify your stand.
 
saikrishna cinux
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, niki

i dont agree with it !
writing java script is WEB DESINERS job...
not the programmers job.....
so java /j2ee developer 's main job is to develop the bussiness logic
and moreover the presentation logic is completely handled by WEB DESIGNERS
so as java script not comes under programming part..... it comes under the presentation logic... am i correct???


if not why??? can u tell me a real world example....
any way i thank for ur above msg.....

cinux
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

if you are a web developer then how can you design a page without the use of javascript???
web development involves use of javascript to a very large extent.

...unless you are writing a web app for a browser which does not support JavaScript (such as for a BlackBerry). Or one where the user has disabled JavaScript. My experience has been its always better to avoid JavaScript unless you have a compelling reason to use it.
[ May 12, 2005: Message edited by: Gregg Bolinger ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While Javascript can be used on the client to perform first-run validations in order to minimize the overhead of sending known bad data to the server, validations should always, always, always, and did I mention, ALWAYS be performed on the server.

Data coming in from the client can never be trusted. The user may have disabled Javascript, the browser they are using may have a poor Javascript engine, a script kiddy could be spoofing your input in order to try to hack your site, and all other manners of nastiness can occur.

Relying upon client-side validation is the height of folly.

So, use it if it makes the "user experience" better (errors caught at an earlier time makes users happy) or reduces the load on your server, but always perform validation on the server as if no client-side validation had ever taken place.

I also find this statement:

so java /j2ee developer 's main job is to develop the bussiness logic
and moreover the presentation logic is completely handled by WEB DESIGNERS


to be elitist and foolish.
[ May 12, 2005: Message edited by: Bear Bibeault ]
 
saikrishna cinux
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello ,
some of u say that for client side validations javascript must be used

and

other's say that it would be a problem if he user may have disabled Javascript, the browser they are using may have a poor Javascript engine, a script kiddy could be spoofing your input in order to try to hack your site, and all other manners of nastiness can occur.

what to do now....???

so overall preference goes to which one...
if i develop a webapplication whcih is similar to yahoo reg. form so what should i use ... there javascript or server side validation which is the better when performance,reliable and security is CONSIDERED!...



i am thankful, if any one guide me to develop that webappp

cinux
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
there javascript or server side validation which is the better when performance,reliable and security is CONSIDERED!


There is no security with Javascript. So if that is one of your considerations (and it should be one of the prime considerations), you must perform server-side validation. Whether you also provide client-side validation to make things nicer for the users is a matter of choice.
 
saikrishna cinux
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello sir,
Atlast i agree with ur suggestion but the problem is what r the actual duties of a j2ee developer.... how many things he should look after...
i mean a j2ee programmer should handle... mainly the bussiness logic.
coz in a s/w industry if the developer go on handling this client side validations' then there will be a lot of burden for a programmer...

and what will WebDesigner do.... reg this issue..??? only designing the web pages using html...???

no not like this i think actually its his duty to handle alll this garbage work

am i right???

if not plz can u tell me
the actual duties of a WEB DESIGNER and the PROGRAMMER

thanx in advance

cinux
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The issue of what are the duties of a developer vs. a designer is not suited to this forum. If you would like to discuss this further please post a topic in the Jobs Discussion forum.
 
saikrishna cinux
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok sir thank u i am shifting this question to the job's forum once again thanks for ur suggestion... and at the same time i apologize reg.. elongation of this simple issu...

but i have again one doubt....
is there any other alternative other than java scrip and buss logic for cline side validation ....???


cinux
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Javascript is pretty much all you've got for a toolset for performing client-side validation in HTML pages (which JSP pages are sent to the browser as).
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thinking that, on the one hand, you're too high up on the food chain to ever have to touch client side code, and on the other that it's burdensome to have to learn it is a bad way to start out.

If you're working in a large enough shop, you may find your self only working with server side code -- having a separate department that handles all of your design and UI work. For many of the smaller shops however, developers have to wear multiple hats. I hand my web-designer fully functioning (but not at all good looking) pages. I write the redundant client side validation myself. He worries about what they look like.

Public sites that have to run on the internet and have to run in almost every browser, largely have to stay away from Javascript. Many intranet apps, however, are written to support one or two browsers and lean heavily on the abundant processing power contained in modern PCs. I've worked on financial apps that perform all kinds of calculations and do all kinds of data transformation inside the browser before ever submitting a post.
These calculations were written in Javascript by serious programmers, not designers with graphic arts backgrounds.

Also remember, much of a J2EE developer's work is debugging and enhancements. Most often this work takes place long after the site has been through the art house and signed off on. If you can't roll up your sleeves and fix or enhance something without requiring a separate UI developer to come in and deal with client-side scripting code, your value as a programmer is going to be severely limited.

Javacript is just one of many tools we have at our disposal.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you say you can not do JavaScript, you can learn the basics in one day by picking up any book or reading a totorial. Reason why people fear it is they try to do fancy things before the basics! Did you start out programming Java by writing detailed business logic?

If anyone wants to do client side validation without any pain and suffering, check this library out: http://www.peterbailey.net/fValidate/

If you want to know why not to rely on JavaScript, look at this:
http://radio.javaranch.com/pascarello/2004/04/28/1083160143000.html

Eric
 
saikrishna cinux
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
Anyway atlast i understood that javascrpt is manadatory for client side validations....

so does every serverside(n/w programmer like .net and j2ee) needs to develop the webapplications using javascript for client side validations.....


if any resources(source code, and prj's
) provided reg. javascript will be apreciatable....
thanking u sir
 
saikrishna cinux
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi to all the ranch memebers ,
plz i want help from u i accept that javascript a must learn .........
for every developer...
so plz can any one tell me where can i find resources for it...

thanks in advance...
cinux
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://www.coderanch.com/forums/f-20/HTML-JavaScript
(We won't tell them that you called their craft 'garbage work'.)



And there's alway Google:
http://www.google.com/search?hl=en&q=JAVASCRIPT+TUTORIAL&btnG=Google+Search
[ May 14, 2005: Message edited by: Ben Souther ]
 
saikrishna cinux
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

thanx for the resources (links), i am happy for that....
and also keep sending resources if u get any....in the middle...

any way i am thankful to u sir..


thanx
cinux
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!