473,511 Members | 16,068 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 3843
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
1393
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...
14
6268
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)...
4
4123
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...
1
1548
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...
1
5855
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,...
10
2015
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...
6
6044
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.....
10
1497
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...
1
2140
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...
0
7138
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...
0
7353
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7075
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...
0
5662
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,...
1
5063
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4737
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...
0
3222
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1572
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
446
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...

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.