473,405 Members | 2,445 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Strange problem with validation

Hello!

My problem is that i have validation controls on my webform but they are not
"fired"
because there is no "onclick" event being made on the button that should
"fire" off the
validation controls. I have tried to add the onclick event by myself by
adding:

LoginBtn.Attributes.Add("onclick", "if (typeof(Page_ClientValidate) ==
'function') Page_ClientValidate(); ")

But that is not good enough because i need some server validation as well.
The strangest
is that I have two web applications, one that works perfectly and one that
doesn't.

Can anyone think of any reason why the onclick event should not be created?

Hope for some help, I'm stuck.

Regards,
Marius
Nov 18 '05 #1
2 1127
Hi, Marius Traelnes,

Check that all the needed attributes are set on the validation controls:

runat="server"
controltovalidate="someControlID"

Hope this helps
Martin
"Marius Traelnes" <no****@spam.no> wrote in message
news:#O**************@TK2MSFTNGP12.phx.gbl...
Hello!

My problem is that i have validation controls on my webform but they are not "fired"
because there is no "onclick" event being made on the button that should
"fire" off the
validation controls. I have tried to add the onclick event by myself by
adding:

LoginBtn.Attributes.Add("onclick", "if (typeof(Page_ClientValidate) ==
'function') Page_ClientValidate(); ")

But that is not good enough because i need some server validation as well.
The strangest
is that I have two web applications, one that works perfectly and one that
doesn't.

Can anyone think of any reason why the onclick event should not be created?
Hope for some help, I'm stuck.

Regards,
Marius

Nov 18 '05 #2
Marius,
if you are creating onClick event its normally for the client side if u are
adding it as you have mentioned.
But you cannot fire both serve side and client side at a go.
You need to decide which is more important and then you need to code it
accordingly.
If you want to check if Client side is running just run a simple javascript.
Add a javascript whichsays 'hello' and then add the function name in your
attribute.add("onclick","javascript:hello();")
if this fires then client side onclick is working gr8.
Arvind.
"Marius Traelnes" <no****@spam.no> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hello!

My problem is that i have validation controls on my webform but they are not "fired"
because there is no "onclick" event being made on the button that should
"fire" off the
validation controls. I have tried to add the onclick event by myself by
adding:

LoginBtn.Attributes.Add("onclick", "if (typeof(Page_ClientValidate) ==
'function') Page_ClientValidate(); ")

But that is not good enough because i need some server validation as well.
The strangest
is that I have two web applications, one that works perfectly and one that
doesn't.

Can anyone think of any reason why the onclick event should not be created?
Hope for some help, I'm stuck.

Regards,
Marius

Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Moshe | last post by:
Page with a <form> action calls ASP page. The ASP page has the following structure <%@ LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <% Option Explicit %> <% Server.ScriptTimeOut=100 With Response...
2
by: Arthur | last post by:
I've come across some strange xml, that I need to deal with, it looks like this:- <root> <foo attr="1">Some random strange text. <bar attr="2">blar</bar> <bar attr="3">blar blar</bar> <bar...
9
by: Stephen Melia | last post by:
Hello, I've just done a redesign of website, and it's gone terribly wrong for Internet Explorer 6. I have a two column layout, and for some reason links in the right hand column cannot be...
0
by: Al Cohen | last post by:
I just installed Server 2003 Web Edition, and all updates. I thereupon installed a web application that had been working fine for some time on Server 2003 Enterprise Evaluation, and the...
2
by: Alex Nitulescu | last post by:
Hi. I have created a web-based "file manager", for remote-administration of a web-site. It works okay. The "main" form in the "file manager" is BrowseFiles.aspx. I can edit the text files (among...
7
by: Tim_Mac | last post by:
hi, using .net 2.0, i have a web form with lots of textboxes, drop-down-lists etc. There are lots of required field validators and regular expression validators. When i click the 'save' button,...
7
by: ace | last post by:
Hi guys, i'm new with CSS and just recently doomed into redoing my site due to some hard to explain incident. i didn't realize the difficulty inherent in doing a 3 column CSS. in any case, i...
28
by: charlie | last post by:
Hi, I found an article on informit.com that talks about C++ casts http://www.informit.com/guides/content.asp?g=cplusplus&seqNum=285&rl=1 The strange thing is the author says the following...
4
by: Eric Layman | last post by:
Hi everyone, Im puzzled by a NULL behaviour in SQL 2000 server. There is a column in the table that does not allow NULL. During data mining, the staff noted that, for that particular column,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
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...

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.