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

change value of a variable

Hi to all,

I have this javascript code inside my aspx page, but i would like to change
the value of the variable lunch depending if i click a button in my form. i
dont know if its possible.

Here is the code:

<head>
<script language="javascript">
var lunch=2;
</script>
</head>

--
Thanks very much.
Regards.
Josema
Nov 16 '05 #1
1 1771
Josema,

In the onclick handler for your javascript, all you should have to do is
"lunch = 4;" or whatever you want to set it to. For example:

<input type="button" onclick="lunch=4;">

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Josema" <Je******@ocu.org> wrote in message
news:3D**********************************@microsof t.com...
Hi to all,

I have this javascript code inside my aspx page, but i would like to
change
the value of the variable lunch depending if i click a button in my form.
i
dont know if its possible.

Here is the code:
--
Thanks very much.
Regards.
Josema

Nov 16 '05 #2

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

Similar topics

4
by: Richard Cornford | last post by:
For the last couple of months I have been trying to get the next round of updates to the FAQ underway and been being thwarted by a heavy workload (the project I am working on has to be finished an...
3
by: Byron | last post by:
Hi, Javascript confuses me, so I usually limit myself to Dreamweaver's built-in scripts for stuff like imageswaps. But this time I'm trying to write something very simple myself. I do most of my...
1
by: Varadha | last post by:
Hi, I am declaring a variable static char Version_No = '1' in header file header.h In a application "app.exe", i am changing the value of the variable in to '2' In the same application i am...
0
by: Anonieko Ramos | last post by:
Answer. Use IHttpHandler. thanks Ro ry for coming up with this code. It processes css file to add variables. neat idea using System; using System.IO; using System.Text; using...
4
by: Shapper | last post by:
Hello, I have this image in my HTML code: <img src="images/en-US/myImage.jpg" /> I want to change the URL using the value of a Session variable. <img src="images/ Session("culture") Value...
0
by: josemario.hernandez | last post by:
Hi, I'm having a issue trying to change the value of a session variable. It seems like I just can set my session variable one time in the sessión. For example if I write: Session("Variable") =...
5
by: Maxwell2006 | last post by:
Hi, Can I have a breakpoint that stop execution as soon as any code change the value of a specific variable? Thank you, Max
3
by: vatsa | last post by:
Hi all, we can simply change value of PS1 from command prompt . but I want to change the value of PS1 from within a c program. i tried to do that using getenv & putenv. but it is n't...
7
by: dotnetnoob | last post by:
i keep getting Object references not set to an instance of an object from this code: Private Sub EqBinding() Dim x As Integer x = 0 Do If CStr(arlsType.Item(x)) = "Bacnet Point" Then Dim...
3
by: tc | last post by:
I'm trying to put together a small control. It's not, but for arguments sake, let's say it's a progress bar. The user will make a change to a setting, lets call it 'value'. I want to trap the...
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...
0
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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: 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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.