473,320 Members | 1,865 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,320 software developers and data experts.

Webcontrol calling JavaScript Function


Anyone have an example of a webuser control with a checkbox that passes
information to a JavaScript function on the same page?
on the page I have a checkbox and a textbox (both are server controls).

I want for texbox(server control) information to be passed to the
JavaScript Function WHEN the checkbox (server control) is clicked.

Any examples of this?
*** Sent via Developersdex http://www.developersdex.com ***
Mar 23 '07 #1
1 1731
On Mar 23, 5:22 pm, Larry <dontspa...@nospamhere.comwrote:
Anyone have an example of a webuser control with a checkbox that passes
information to a JavaScript function on the same page?
on the page I have a checkbox and a textbox (both are server controls).

I want for texbox(server control) information to be passed to the
JavaScript Function WHEN the checkbox (server control) is clicked.

Any examples of this?

*** Sent via Developersdexhttp://www.developersdex.com***
in Page load of code behind...

CheckBox1.Attributes.Add("onClick", "SomeFunction('" TextBox1.ClientID
+ "');");

In page...

<script language=javascript type="text/javascript">
function SomeFunction(textboxid)
{
if(Checkbox1.checked)
var Text = document.getElementById(textboxid).value;
}
</script>

thanks

Mar 24 '07 #2

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

Similar topics

1
by: chris | last post by:
Hi there, I would like to add an onClick event to a webcontrol which calls a function which is in the code behind an not a javascript. Would that be possible? Something like this: ...
0
by: Matze | last post by:
I have a function that has an Argument of type System.Web.UI.WebControls.WebControl. I want to set the text-property of that control. Of course it doesnt work if I cast that control to...
5
by: Jon | last post by:
I would like to pass a reference of a webcontrol into a javascript function. Below I have a snippet of code. "me.selectedValue" returns undefined. I was hoping that would return the value that...
0
by: Lucas, Todd | last post by:
Hello everyone! I'm having a problem with a WebControl that I'm designing for a Menu. I've been at it for about 3 weeks now, and can't seem to get around this problem. So I'm hoping that someone...
9
by: kw | last post by:
What is the proper way to get the element ID for a client script? For example, suppose in the WebControl: TextBox t=new TextBox; t.ID=this.ClientID+"X"; .... Then elsewhere we want to access...
0
by: Mike Hofer | last post by:
Hi everyone. I could really use some help. First, the backstory: ===================== I *really* need a 3-state checkbox for my ASP.NET application. Specifically, I need one that lets me set...
0
by: Charlie | last post by:
When a property of a WebControl is changed at design-time in the property window, the Render method for that WebControls runs. When the property of one WebControl cascades to another WebControl,...
2
by: Peregrin | last post by:
Hello world. I will try to explain my problem. I've a webcontrol with an interface which provides a choice of methods. After including the webcontrol in a special aspx page, I want to call an...
0
by: pagates | last post by:
Hello All, For links in my page, I would like to change the window.status to show something a little friendlier than "javascript:WebForm_DoPostBackWithOptions(.............)". I thought that...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.