473,748 Members | 10,048 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

why wont my function 'EnableValidato rs' fire?

<a id="MyDataList_ _ctl1_edit_Butt on" NAME="edit_Butt on"
OnMousedown="En ableValidators( 'editGroup_');" href="javascrip t:{if
(typeof(Page_Cl ientValidate) != 'function' || Page_ClientVali date())
__doPostBack('M yDataList$_ctl1 $edit_Button',' ')} ">Edit</a>

In the above example, the function 'EnableValidato rs' does not fire. Has it
got something to do with the fact the id and name attributes are different?
I am unable to make the id and name attributes the same so is there anything
I can do to get it to work?

Thanks in advance.
Jul 23 '05 #1
6 2135
Lee
Dufus said:

<a id="MyDataList_ _ctl1_edit_Butt on" NAME="edit_Butt on"
OnMousedown="E nableValidators ('editGroup_'); " href="javascrip t:{if
(typeof(Page_C lientValidate) != 'function' || Page_ClientVali date())
__doPostBack(' MyDataList$_ctl 1$edit_Button', '')} ">Edit</a>

In the above example, the function 'EnableValidato rs' does not fire. Has it
got something to do with the fact the id and name attributes are different?
I am unable to make the id and name attributes the same so is there anything
I can do to get it to work?


What makes you think that EnableValidator s() isn't being called?
Maybe that function isn't working.

Jul 23 '05 #2

"Lee" <RE************ **@cox.net> wrote in message
news:cn******** *@drn.newsguy.c om...
Dufus said:

<a id="MyDataList_ _ctl1_edit_Butt on" NAME="edit_Butt on"
OnMousedown=" EnableValidator s('editGroup_') ;" href="javascrip t:{if
(typeof(Page_ ClientValidate) != 'function' || Page_ClientVali date())
__doPostBack( 'MyDataList$_ct l1$edit_Button' ,'')} ">Edit</a>

In the above example, the function 'EnableValidato rs' does not fire. Has
it
got something to do with the fact the id and name attributes are
different?
I am unable to make the id and name attributes the same so is there
anything
I can do to get it to work?


What makes you think that EnableValidator s() isn't being called?
Maybe that function isn't working.


it works because I have stripped it down to just an alert box and have
successfully called it from elsewhere.
Jul 23 '05 #3
Dufus wrote:
<a id="MyDataList_ _ctl1_edit_Butt on" NAME="edit_Butt on"
OnMousedown="En ableValidators( 'editGroup_');" href="javascrip t:{if
(typeof(Page_Cl ientValidate) != 'function' || Page_ClientVali date())
__doPostBack('M yDataList$_ctl1 $edit_Button',' ')} ">Edit</a>

In the above example, the function 'EnableValidato rs' does not fire. Has it
got something to do with the fact the id and name attributes are different?
I am unable to make the id and name attributes the same so is there anything
I can do to get it to work?


From the HTML spec at W3C.org:

"The id and name attributes share the same name space. This means that
they cannot both define an anchor with the same name in the same
document. It is permissible to use both attributes to specify an
element's unique identifier for the following elements: A, APPLET,
FORM, FRAME, IFRAME, IMG, and MAP. *When both attributes are used on a
single element, their values must be identical.*" (my emphasis).

<URL: http://www.w3.org/TR/html4/struct/links.html#h-12.2.3>

As for the rest of your element...

Not sure what you are trying to achieve. If your intention is for
EnableValidator s to run onmousedown, then for the script attached to
the href to execute, it does not work in all browsers. Safari (and
maybe others) will not run the script on the href if another function
fires (onclick, onmousedown, etc.).

The usual idea is to have the href go to a useful page for those with
JavaScript disabled, then have the onmousedown end with

return false;

which stops the browser from following the href link if javascript is
enabled.

Then add the script you have on the href to the end of the onmousedown:

<a id="MyDataList_ _ctl1_edit_Butt on" NAME="edit_Butt on"
href="aUsefulPa ge.html"
OnMousedown="
EnableValidator s('editGroup_') ;
if (typeof(Page_Cl ientValidate) != 'function' ||
Page_ClientVali date())
__doPostBack('M yDataList$_ctl1 $edit_Button',' ');
return false;
">Edit</a>

The above is utterly untested 'cos I have no idea what all your
functions are, however the syntax should be correct.

Rob.
Jul 23 '05 #4
Dufus wrote:
<a id="MyDataList_ _ctl1_edit_Butt on" NAME="edit_Butt on"
OnMousedown="En ableValidators( 'editGroup_');" href="javascrip t:{if
(typeof(Page_Cl ientValidate) != 'function' || Page_ClientVali date())
__doPostBack('M yDataList$_ctl1 $edit_Button',' ')} ">Edit</a>

In the above example, the function 'EnableValidato rs' does not fire. Has it
got something to do with the fact the id and name attributes are different?
I am unable to make the id and name attributes the same so is there anything
I can do to get it to work?


From the HTML spec at W3C.org:

"The id and name attributes share the same name space. This means that
they cannot both define an anchor with the same name in the same
document. It is permissible to use both attributes to specify an
element's unique identifier for the following elements: A, APPLET,
FORM, FRAME, IFRAME, IMG, and MAP. *When both attributes are used on a
single element, their values must be identical.*" (my emphasis).

<URL: http://www.w3.org/TR/html4/struct/links.html#h-12.2.3>

As for the rest of your element...

Not sure what you are trying to achieve. If your intention is for
EnableValidator s to run onmousedown, then for the script attached to
the href to execute, it does not work in all browsers. Safari (and
maybe others) will not run the script on the href if another function
fires (onclick, onmousedown, etc.).

The usual idea is to have the href go to a useful page for those with
JavaScript disabled, then have the onmousedown end with

return false;

which stops the browser from following the href link if javascript is
enabled.

Then add the script you have on the href to the end of the onmousedown:

<a id="MyDataList_ _ctl1_edit_Butt on" NAME="edit_Butt on"
href="aUsefulPa ge.html"
OnMousedown="
EnableValidator s('editGroup_') ;
if (typeof(Page_Cl ientValidate) != 'function' ||
Page_ClientVali date())
__doPostBack('M yDataList$_ctl1 $edit_Button',' ');
return false;
">Edit</a>

The above is utterly untested 'cos I have no idea what all your
functions are, however the syntax should be correct, except I haven't
fixed your invalid id/name combination.

Rob.
Jul 23 '05 #5
Dufus wrote:
<a id="MyDataList_ _ctl1_edit_Butt on" NAME="edit_Butt on"
OnMousedown="En ableValidators( 'editGroup_');" href="javascrip t:{if
(typeof(Page_Cl ientValidate) != 'function' || Page_ClientVali date())
__doPostBack('M yDataList$_ctl1 $edit_Button',' ')} ">Edit</a>

In the above example, the function 'EnableValidato rs' does not fire. Has it
got something to do with the fact the id and name attributes are different?
I am unable to make the id and name attributes the same so is there anything
I can do to get it to work?

From the HTML spec at W3C.org:

"The id and name attributes share the same name space. This means that
they cannot both define an anchor with the same name in the same
document. It is permissible to use both attributes to specify an
element's unique identifier for the following elements: A, APPLET,
FORM, FRAME, IFRAME, IMG, and MAP. *When both attributes are used on a
single element, their values must be identical.*" (my emphasis).

<URL: http://www.w3.org/TR/html4/struct/links.html#h-12.2.3>

As for the rest of your element...

Not sure what you are trying to achieve. If your intention is for
EnableValidator s to run onmousedown, then for the script attached to
the href to execute, it does not work in all browsers. Safari (and
maybe others) will not run the script on the href if another function
fires (onclick, onmousedown, etc.).

The usual idea is to have the href go to a useful page for those with
JavaScript disabled, then have the onmousedown end with

return false;

which stops the browser from following the href link if javascript is
enabled.

Then add the script you have on the href to the end of the onmousedown:

<a id="MyDataList_ _ctl1_edit_Butt on" NAME="edit_Butt on"
href="aUsefulPa ge.html"
OnMousedown="
EnableValidator s('editGroup_') ;
if (typeof(Page_Cl ientValidate) != 'function' ||
Page_ClientVali date())
__doPostBack('M yDataList$_ctl1 $edit_Button',' ');
return false;
">Edit</a>

The above is utterly untested 'cos I have no idea what all your
functions are, however the syntax should be correct, except I haven't
fixed your invalid id/name combination.

Rob.
Jul 23 '05 #6

"RobG" <rg***@iinet.ne t.auau> wrote in message
news:41******** *************** @per-qv1-newsreader-01.iinet.net.au ...
Dufus wrote:
<a id="MyDataList_ _ctl1_edit_Butt on" NAME="edit_Butt on"
OnMousedown="En ableValidators( 'editGroup_');" href="javascrip t:{if
(typeof(Page_Cl ientValidate) != 'function' || Page_ClientVali date())
__doPostBack('M yDataList$_ctl1 $edit_Button',' ')} ">Edit</a>

In the above example, the function 'EnableValidato rs' does not fire. Has
it got something to do with the fact the id and name attributes are
different? I am unable to make the id and name attributes the same so is
there anything I can do to get it to work?

From the HTML spec at W3C.org:

"The id and name attributes share the same name space. This means that
they cannot both define an anchor with the same name in the same
document. It is permissible to use both attributes to specify an
element's unique identifier for the following elements: A, APPLET,
FORM, FRAME, IFRAME, IMG, and MAP. *When both attributes are used on a
single element, their values must be identical.*" (my emphasis).

<URL: http://www.w3.org/TR/html4/struct/links.html#h-12.2.3>

As for the rest of your element...

Not sure what you are trying to achieve. If your intention is for
EnableValidator s to run onmousedown, then for the script attached to
the href to execute, it does not work in all browsers. Safari (and
maybe others) will not run the script on the href if another function
fires (onclick, onmousedown, etc.).

The usual idea is to have the href go to a useful page for those with
JavaScript disabled, then have the onmousedown end with

return false;

which stops the browser from following the href link if javascript is
enabled.

Then add the script you have on the href to the end of the onmousedown:

<a id="MyDataList_ _ctl1_edit_Butt on" NAME="edit_Butt on"
href="aUsefulPa ge.html"
OnMousedown="
EnableValidator s('editGroup_') ;
if (typeof(Page_Cl ientValidate) != 'function' ||
Page_ClientVali date())
__doPostBack('M yDataList$_ctl1 $edit_Button',' ');
return false;
">Edit</a>

The above is utterly untested 'cos I have no idea what all your
functions are, however the syntax should be correct, except I haven't
fixed your invalid id/name combination.

Rob.


Thanks Rob. That was very helpful.
Jul 23 '05 #7

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

Similar topics

3
4053
by: JoeK | last post by:
Hey all, I am automating a web page from Visual Foxpro. I can control all the textboxes, radio buttons, and command buttons using syntax such as: oIE.Document.Forms("searchform").Item(<name>).Value = <myvalue> But I cannot control a dropdown with an onchange event. I can set the dropdown's value and selectedIndex, but then calling the onChange() or Click() does not do anything. It only seems to fire the onchange if I
45
3290
by: JaSeong Ju | last post by:
I would like to overload a C function. Is there any easy way to do this?
51
2562
by: Richard Hengeveld | last post by:
Hi all, I'm trying to understand how pointers for function parameters work. As I understand it, if you got a function like: void f(int *i) { *i = 0; }
5
3138
by: David Lozzi | last post by:
Hey All, I have a listbox that I would like to fire an event on doubleclick. the onDoubleClick property of the listbox isnt available be default, and I know it will work with Javascript, but how do I use javascript to run a server side function? Currently, I am using a Next button to accept the change, but it would be a faster UI to have the option to doubleclick instead. thanks a ton! david lozzi
2
1261
by: Adrian | last post by:
Hi everyone I have a web form where the validation works pefectly I copied the file, renamed it, and all of a sudden the validation stopped working(on the copied form). I have two panels on them. Both have validation controls in them and only one panel is visible at a time. The first panel validtion works fine, but the 2nd one doesnt. All it has is few textboxes, a requiredValidator and a image command button. The valdiation is server...
0
949
by: Phil | last post by:
I'm trying to add custom error handling for a 401 error. I've added this to my web.config: <location path="admin"> <system.web> <authorization> <allow roles="\" /> <deny users="*" /> </authorization> </system.web> </location>
5
1970
by: Gary Wessle | last post by:
Hi I have a group of functions which have the same signature. void fun_n(void); according to a conditional structure "be it if-else or switch-case" I get to choose which one to run. conditional structure verifies a short type and fires the fun_n in its block.
1
2654
by: Fendi Baba | last post by:
I wrote a simple validation routine. I am trying to trigger validation on group of fields if an option on another radio button is selected. Sub ValidateAdd_ServerValidate(ByVal objSource As Object, ByVal objArgs As ServerValidateEventArgs) if radioDbutton.SelectedItem.Value="yes" Then
3
7545
by: =?Utf-8?B?SlA=?= | last post by:
<asp:GridView ID="gridResults" runat="server" AutoGenerateColumns="False" Width="98%" PageSize="25" AllowPaging="True" OnSorting="gridResults_Sorting" OnPageIndexChanging ="gridResults_PageIndexChange" AllowSorting="True" OnRowDataBound="gridResults_RowDataBound" EnableViewState="False" OnRowCommand="gridResults_Command" ></asp:GridView> Inside a <ItemTemplateI have an <asp:ImageButton> The problem is that no matter what I do,...
0
8989
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
9367
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
9319
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
8241
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...
1
6795
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6073
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
4599
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4869
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2213
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.