473,511 Members | 15,156 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

attribute concatenation problem

hi all, please see the followin line :

<input type="submit" name="btnRemove" value="Remove" onclick="if (typeof(Page_ClientValidate) == 'function') Page_ClientValidate(); " language="javascript" id="btnRemove" class="button" onClick="alert(2);" />

In above line, u can see that onclick event is called twice. why it is so?
If i want to concatenate it, what should i do?
Please reply me, if u have the solution.
Thanks.
--------------------------------
From: Pinkesh Achhodwala

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>Tr2ytCpNJk67+//OrsyOSg==</Id>
Nov 18 '05 #1
2 1119
Hi,
write this code on the page load
btnRemove.Attributes.Add("OnClick", "alert(2);")
Hope it helps.
--
The best
srini
"Pinkesh Achhodwala via .NET 247" wrote:
hi all, please see the followin line :

<input type="submit" name="btnRemove" value="Remove" onclick="if (typeof(Page_ClientValidate) == 'function') Page_ClientValidate(); " language="javascript" id="btnRemove" class="button" onClick="alert(2);" />

In above line, u can see that onclick event is called twice. why it is so?
If i want to concatenate it, what should i do?
Please reply me, if u have the solution.
Thanks.
--------------------------------
From: Pinkesh Achhodwala

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>Tr2ytCpNJk67+//OrsyOSg==</Id>

Nov 18 '05 #2
Hi,
Concatenate all of your code in a js function.
Sample is below.

Good Luck
Adnan

<input ... onclick="myclick();" ... >

<script language=javascript>
function myclick(){
if (typeof(Page_ClientValidate) == 'function')
Page_ClientValidate();
alert(2);
}
<script>

"Pinkesh Achhodwala via .NET 247" <an*******@dotnet247.com> wrote in message
news:#Y*************@tk2msftngp13.phx.gbl...
hi all, please see the followin line :

<input type="submit" name="btnRemove" value="Remove" onclick="if (typeof(Page_ClientValidate) == 'function') Page_ClientValidate(); "
language="javascript" id="btnRemove" class="button" onClick="alert(2);" />
In above line, u can see that onclick event is called twice. why it is so?
If i want to concatenate it, what should i do?
Please reply me, if u have the solution.
Thanks.
--------------------------------
From: Pinkesh Achhodwala

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>Tr2ytCpNJk67+//OrsyOSg==</Id>

Nov 18 '05 #3

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

Similar topics

5
3620
by: Jonas Galvez | last post by:
Is it true that joining the string elements of a list is faster than concatenating them via the '+' operator? "".join() vs 'a'+'b'+'c' If so, can anyone explain why?
1
14124
by: G Kannan | last post by:
Hey all! I have written a perl script to retrieve information from a HTML Form and insert the data into an Oracle database table. I am gettting the the following error message: "Use of...
5
1181
by: Haydnw | last post by:
I have the following line of code in a code-behind file. It's part of a event which is run when a user clicks an asp:imagebutton on a page. tblMainImage.Rows.Cells.Attributes.Add("background",...
33
4634
by: genc_ymeri | last post by:
Hi over there, Propably this subject is discussed over and over several times. I did google it too but I was a little bit surprised what I read on internet when it comes 'when to use what'. Most...
34
2616
by: Larry Hastings | last post by:
This is such a long posting that I've broken it out into sections. Note that while developing this patch I discovered a Subtle Bug in CPython, which I have discussed in its own section below. ...
0
7251
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,...
0
7148
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
7430
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...
1
7089
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
4743
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
3217
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1581
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 ...
1
790
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
451
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.