473,577 Members | 3,192 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>
  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 3612
8,658 Recognized Expert Moderator Expert
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
200 New Member
I got it going :)
Thank You

Expand|Select|Wrap|Line Numbers
  1. {@name}.click();
Oct 15 '09 #3
8,658 Recognized Expert Moderator Expert
right… didn’t remember ’cause I hardly use those (despite the fact I don’t use inline Javascript either)
Oct 15 '09 #4
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

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">...
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?
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?
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 =...
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.
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
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? ...
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...
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() {
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...
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...
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
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...
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...
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...
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...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.