Client validation not firing

J

John Dalberg

I have an aspx page that was developed initially in Dreamweaver as a
regular html file. I have added a few textboxes and required validators.
The problem is that the client side validation is not firing. Only server
side is working

- I have verified javascript is enabled
- aspnet_client folder is present. Other aspx apps with validation work
fine.
- I can see validation JS code in the html plus the "onsubmit="if
(!ValidatorOnSubmit()) return false;" part in the form tag.

- I have "<meta content=JavaScript name=vs_defaultClientScript>"

Is there something else I might have missed?
 
M

Marina

Are you sure there are no javascript errors on the page that could be
interfering? Unless you have your IE settings set to display every error,
you would just get an icon in the lower left hand corner.

Also, try creating just the most basic page to reproduce this problem. Try
it in both the apps that work, and the one that doesn't. If the basic page
works, then there is some issue with your app.
 
J

John Dalberg

Are you sure there are no javascript errors on the page that could be
interfering? Unless you have your IE settings set to display every error,
you would just get an icon in the lower left hand corner.

Also, try creating just the most basic page to reproduce this problem. Try
it in both the apps that work, and the one that doesn't. If the basic page
works, then there is some issue with your app.


There are no Javascript errors. I haven't created any of my own and there's
no icon when I submit the form.

A basic app from VS will work. I tool a Dreamweaver html page and I have
been converting the html controls to asp.net. I have been looking in what
VS creates and adding them into the dw one. I even added a dummy textbox
and a validation control from the toolbox just to have vs add the extras if
they are missing. Even the clientscript for that textbox didn't fire.
Enableclientscript is enabled. I am missing something but can't find it.
 
J

John Dalberg

Hey John:
Just a thought, are you using something other than IE? client side
validation doesn't work in non-IE browsers...there are some free DOM
compatible validation controls out there...

Karl

I am using IE. VS doesn't create validation scripts for non IE or at least
non compatible IE browsers. I am seeing the JS validation scripts in the
html output.

I guess my next step is trace the JS.
 
M

Marina

Does your sample page work in one of the other apps that you say work?

If no javascript is working at all on this page, then the only thing that I
can think of is that IE setting prohibit javascript running in the browser.
 
P

Peter Blum

Hi John,

You indicated that you confirmed the presence of the \aspnet_client folder.
Its actually a specific subfolder needed in there. Confirm that you have
\aspnet_client\system_web\[.net version]\
Often users have copied a different version (including a different service
pack) to the production server than matches the version of ASP.NET on that
server.
That's why you should run aspnet_regiis.exe -c.

Just in case its relevant, see this thread:
http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=739537

--- Peter Blum
www.PeterBlum.com
Email: (e-mail address removed)
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx
 
J

John Dalberg

I have an aspx page that was developed initially in Dreamweaver as a
regular html file. I have added a few textboxes and required validators.
The problem is that the client side validation is not firing. Only server
side is working

- I have verified javascript is enabled
- aspnet_client folder is present. Other aspx apps with validation work
fine.
- I can see validation JS code in the html plus the "onsubmit="if
(!ValidatorOnSubmit()) return false;" part in the form tag.

- I have "<meta content=JavaScript name=vs_defaultClientScript>"

Is there something else I might have missed?


doh.. I found it! The submit button didn't have an onclick event.
 
J

John Dalberg

Hi John,

You indicated that you confirmed the presence of the \aspnet_client folder.
Its actually a specific subfolder needed in there. Confirm that you have
\aspnet_client\system_web\[.net version]\
Often users have copied a different version (including a different service
pack) to the production server than matches the version of ASP.NET on that
server.
That's why you should run aspnet_regiis.exe -c.

I have several asp.net apps under wwwroot and they have validation controls
in them and they run fine so it can't be the folder. The javascript I saw
running is from the javascript in the form tag. After more investigation
the problem was as small as that the submit button didn't have runat
attribue. It was submitting alright but asp.net wasn't adding the needed
onclick event to run the rest of the JS.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top