473,668 Members | 2,632 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Client side and server side validations compatibility

283 Contributor
Hi friends,
I guess i am asking this question in the right forum.
I have a jsp page where i have a javascript date picker function enabled. This part is working perfectly, but when i tried to do a server side validation for empty fields, it failed to fire up(i.e the server side error/empty field message). So my question is can a javascript validation and a server side validation coexist(using struts/java) or am i making some silly mistake here?.Thanks
regards,
ajos :)
Jan 3 '08 #1
6 3851
ajos
283 Contributor
Hi friends,
I guess i am asking this question in the right forum.
I have a jsp page where i have a javascript date picker function enabled. This part is working perfectly, but when i tried to do a server side validation for empty fields, it failed to fire up(i.e the server side error/empty field message). So my question is can a javascript validation and a server side validation coexist(using struts/java) or am i making some silly mistake here?.Thanks
regards,
ajos :)
Ok i got the client side script working, but i've got myself into a twisted situation here. My jsp flow goes like--> The user clicks a link, some of the values of that link is passed as hidden parameters to the next jsp page. The hidden parameters are getting displayed in the 2nd jsp page, but when i leave the page blank and click on submit, the value(which i got as hidden) gets null and even my javascript calender gets deactivated(??? ), eventually showing the validation message. Why does this happen with the hidden field and with the javascript calendar?
regards,
ajos
Jan 3 '08 #2
acoder
16,027 Recognized Expert Moderator MVP
Post some code or a link to a test page.
Jan 3 '08 #3
ajos
283 Contributor
Post some code or a link to a test page.
hey thanks for the reply,
Well as i explained about the page flow, i have 3 jsp page next to next i dont know how to put forward the code. Talking about the javascript, the situation is when i enter some values in the a.jsp and click enter the first time the javascript works(for the date picker function). This takes the user to b.jsp page, where he enters some values, and if the values are still remaining to be entered, the user is again taken back to the a.jsp page where for the 2nd time the javascript datepicker fails to execute. I hope i have conveyed myself right. Since i dont have a link to a test page all i could do is to explain the situation a bit more clearly. :)
Jan 3 '08 #4
acoder
16,027 Recognized Expert Moderator MVP
Unless I can see the code, I can only guess what the problem might be.

The server-side validation should work whether there's any client-side validation or not. If you've got client-side validation, it should not submit the page. If it is, you've probably got an error. Post the validation code in a.jsp.
Jan 3 '08 #5
ajos
283 Contributor
Unless I can see the code, I can only guess what the problem might be.

The server-side validation should work whether there's any client-side validation or not. If you've got client-side validation, it should not submit the page. If it is, you've probably got an error. Post the validation code in a.jsp.
Sorry for the late reply. My understanding on client side/server side scripting is that even if i have a server side script for validation, the client side runs first and ultimately the server side script doesnt work. Please correct me if im wrong here :)
Jan 4 '08 #6
acoder
16,027 Recognized Expert Moderator MVP
Sorry for the late reply. My understanding on client side/server side scripting is that even if i have a server side script for validation, the client side runs first and ultimately the server side script doesnt work. Please correct me if im wrong here :)
I wouldn't say it doesn't work. The client-side code does indeed run first. If it passes, the form will submit and the server-side script will run. That way it is validated on both the client and server side. The advantage of client-side validation is that it avoids the need to make a trip to the server just to be greeted with an error message.
Jan 4 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

4
1406
by: byuedwin | last post by:
Hello, I am starting a new website, and I would like to decide ahead of time what functions (in JavaScript) I will need to write on the server side and which ones on the client side. I believe that some validations are important on the client side, and I am thinking of writing some php validations for the server side. What types of functions are usually written on the server side? What types are usually written on the client side?
14
6292
by: Matt | last post by:
I want to know if ASP.NET Web Forms Validation Controls are Server-Side or Client-Side form validation? Since I think each validator control can select either 1) JavaScript based error dialog or 2) show the error message next to the control. For example, if the text field is empty with RequiredField Validator control, it can show the value in ControlToValidate property in two ways as I mentioned. Please advise. Thanks!
4
4129
by: | last post by:
Hi Has anyone any experience using client side validation with asp.net forms. Specifically I'd like to know... 1. How do you attach client side code web controls (a button), like a JavaScript 'onclick' event for example? 2. Any issues anyone has experienced using client side validation with asp.net forms?
1
1553
by: Murat YILMAZ | last post by:
Hi all, I have develop a web page and there are 4 textbox on it. I have put 4 validation for these. Issue is that If I have request this page and submit form validations are not working. But I have put other computer then try again. It is working... I have look source from "view source" selection. And I see what On the my computer was not load some thing to button on click. But other computer was load.
1
5863
by: Anup | last post by:
In my form I and doing validations using 'Javascript' as I m using ASP1.1 and there is very less support for Validators there. //Code Behind private void Page_Load(object sender, System.EventArgs e) { Button1.Attributes.Add("OnClick","fun()"); } Problem in using "Button1.Attributes.Add " for client side script for
10
2043
by: Ben | last post by:
Hi, I made an application in classic asp (reservation of books and video stuffs for students) and want to migrate to asp.net. The user has to chose a date, then pushung on a submit button. The whole day is then displayed in cels of a table. The user has then to click in a cel representing a hour of the day and an object (book ..), and finally click on the submit button to insert that reservation in the database. My problem is: there...
6
6050
by: Charleees | last post by:
Hi all, I have a Login Page whrere all Functionalities such as validations are Done in Client Side... I have to Implement Remember My Mail Id and PAss Word Functionality also in Client side.. When Remember PAssWord Check Box is Checked.....
10
1510
by: polydegmon | last post by:
I'm having a problem with client side validations. When i use the code below it breaks at line 14 "var vSearch = document.getElementById("txtSearch").value;" When i use a simple form with a form tag it works fine, and i have all the functions setup and working on another form. But whenever i put anything into a contentplaceholder it bugs out like crazy. Does anyone know why this happens or if there is a solution that isn't not using master...
1
2149
by: Shraddha | last post by:
Hi, I am adding some ASP.Net user controls (.ascx file) dynamically on the button click. The user control will get added as many times userhits the button. Now on the click of the submit button, I want to do some form level validations. For example suppose my .ascx file contains a text box with id say "trialTextBox". Now if user hits the button thrice, 3 user controls will be there on the page and as a result 3 textboxes mentioned...
0
8459
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8367
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8790
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8570
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7391
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5677
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4372
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2017
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1779
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.