473,748 Members | 2,595 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Use the value of name to an html button onclick click function.

200 New Member
Good day,

I need to use the value of the name to an html button onclick click function.

Expand|Select|Wrap|Line Numbers
  1. <xsl:element name="asp:CheckBox">
  2.    <xsl:attribute name='id'><xsl:value-of select='@name' /></xsl:attribute>     
  3.    <xsl:attribute name='runat'>server</xsl:attribute>
  4. </xsl:element>
  5.  
  6. <input id="btnDone" type="button" value="Done" onClick="@name.click();">
I want to onclick the button click the checkbox.
This does not work onClick="@name.click() ;"
but say the id of the checkbox = Test then onClick="Test.click();" works

Please help!
Oct 15 '09 #1
4 3623
Dormilich
8,658 Recognized Expert Moderator Expert
@ismailc
simple reason, the XPath expression (@name) only works on elements whose attribute value is parsed as such. i.e. the expression must be a) placed in an XSL element and b) the attribute denotes an XPath expression (select, match, test, …)

the best solution IMHO would be an external Javascript file (i.e. resign from using inline Javascript).
Oct 15 '09 #2
ismailc
200 New Member
I got it going :)
Thank You

Expand|Select|Wrap|Line Numbers
  1. {@name}.click();
  2.  
Oct 15 '09 #3
Dormilich
8,658 Recognized Expert Moderator Expert
@ismailc
right… didn’t remember ’cause I hardly use those (despite the fact I don’t use inline Javascript either)
Oct 15 '09 #4
ismailc
200 New Member
Thank You for helping :)
Oct 15 '09 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
5750
by: monika | last post by:
hi ... I have an asp page which has 3 buttons. <p align="center"><input class="button" type="button" onClick="location='welStudent.asp';" value="Click to write a new story"></p> <p align="center"><input class="button" type="button" onClick="location='draftedStory.asp';" value="Click to complete the drafted story"></p> <p align="center"> <input class="button" type="submit" value="Click to view your grade sheet" name="submit"> </p>
24
77383
by: London | last post by:
Hello Can you help me. By ASP How can I get the dropdown(control'name)'s selected value? What is it's property'name?
1
5537
by: koen colen | last post by:
Hello group, I hope you guys can help me out, I am modifying a piece of code from Joe Norman, I did found the code here: http://www.intranet2internet.com/public/default.asp?PAGE=sscript&ID=3 My question: How can I save the value's of a form to a cookie, but in the textarea's of that form the "hard returns" must be saved with it?
16
11501
by: cwizard | last post by:
I'm calling on a function from within this form, and there are values set but every time it gets called I get slammed with a run time error... document.frmKitAmount.txtTotalKitValue is null or not an object... the function is like so: function calc_total() { var x,i,base,margin,total,newmargin,newtotal; base = document.frmKitAmount.txtTotalKitValue.value; margin = document.frmKitAmount.margin.value/100;
8
67460
by: KS | last post by:
Just to show some code to show the consept. <img id="date" onclick="javascript:show_calendar();" src="/PlexSysWeb/images/show-calendar.gif" width=20 height=18 border=0> What i want the javascript to do is change the onclick value of the <IMG> tag above, by calling the test function from the same webpage by onclick on a button.
1
3429
by: MickG | last post by:
I am trying to change the value of the variable "hard" according to which radio button is pressed and I am having no joy. Could anyone help me with this, the problematic section is marked with ***********************, I've included all the code incase that isn't where the problem is. Any help would be hugely appreciated. Mick
11
3007
by: Brian D | last post by:
I have been searching for a while to find an answer to this and I must be searching on the wrong keywords. Below is a snippet of my form. There are other form items on it, but I need to submit a different value based on the image that is clicked. Lets say the name is "image" and the value is . How do I submit this with javascript? <form name="form1" method="post" action="launch.asp">
2
2165
by: joltman | last post by:
OK, this is kind of hard to explain, so I'll do my best: I have a form where I have a row where there could be multiple entries, so I have a link where it will dynamically add another row like it, and this can happen as many times as you click on the link. This row consists of 2 drop-down boxes. Depending on the selection of the first drop-down box, the second drop-down box is either disabled or enabled. The problem is on these dynamically...
5
3966
by: siaj | last post by:
Hello, I have a javascript function for a validation in the HTML page of the asp.Net page.. I call this function in a Savebutton click When the validation fails No postback should happen ( ie Save should not happen) the js function is as function IsValidAmount() {
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
8828
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
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...
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
4869
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
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.