473,545 Members | 4,241 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to execute OnClick with an <a Href

Hi everyone. I'm not from Internet word i have some difficulties with
events.

I have a session variable who change the selected language (French or
English) and i try to change this variable when someone click on my anchor.
This is my code
<%

if session("IdVers ion")="" THEN
intIdVersion=1
Else
intIdVersion=se ssion("IdVersio n")
End if

%>

<script language="JavaS cript" type="text/JavaScript">

function GetLangue(intId Version)
{
if (intIdVersion ==1)
intIdVersion ==2;
Else
intIdVersion ==1;
return intIdVersion;
}
</script>

<a href="default.a sp?IdMenuBande= 2&amp;IdVersion =<%=intIdVersio n%>"
onclick="javasc ript:GetLangue( <%intIdVersion% >)"
class="texteBan deHaut"><font color="#990000" ><%=strVersion% ></font></a>
I liked to return my new version only when a user click on the top menu
where he have the possibility with this two language.

But for now all i received is an error messaor who tell me that there's an
error on the page.


Jul 19 '05 #1
3 14891
Ok hi already found th solution!!!!
"GhislainTangua y" <gh************ **@hotmail.com> a écrit dans le message de
news:eZ******** ******@TK2MSFTN GP09.phx.gbl...
Hi everyone. I'm not from Internet word i have some difficulties with
events.

I have a session variable who change the selected language (French or
English) and i try to change this variable when someone click on my anchor. This is my code
<%

if session("IdVers ion")="" THEN
intIdVersion=1
Else
intIdVersion=se ssion("IdVersio n")
End if

%>

<script language="JavaS cript" type="text/JavaScript">

function GetLangue(intId Version)
{
if (intIdVersion ==1)
intIdVersion ==2;
Else
intIdVersion ==1;
return intIdVersion;
}
</script>

<a href="default.a sp?IdMenuBande= 2&amp;IdVersion =<%=intIdVersio n%>"
onclick="javasc ript:GetLangue( <%intIdVersion% >)"
class="texteBan deHaut"><font color="#990000" ><%=strVersion% ></font></a>
I liked to return my new version only when a user click on the top menu
where he have the possibility with this two language.

But for now all i received is an error messaor who tell me that there's an
error on the page.


Jul 19 '05 #2
You are missing an "=" and you should not have "javascript :" in the onclick
parameter. Use:

onclick="GetLan gue(<=%intIdVer sion%>)"

instead of

onclick="javasc ript:GetLangue( <%intIdVersion% >)"

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"GhislainTangua y" <gh************ **@hotmail.com> wrote in message
news:eZ******** ******@TK2MSFTN GP09.phx.gbl...
Hi everyone. I'm not from Internet word i have some difficulties with
events.

I have a session variable who change the selected language (French or
English) and i try to change this variable when someone click on my anchor. This is my code
<%

if session("IdVers ion")="" THEN
intIdVersion=1
Else
intIdVersion=se ssion("IdVersio n")
End if

%>

<script language="JavaS cript" type="text/JavaScript">

function GetLangue(intId Version)
{
if (intIdVersion ==1)
intIdVersion ==2;
Else
intIdVersion ==1;
return intIdVersion;
}
</script>

<a href="default.a sp?IdMenuBande= 2&amp;IdVersion =<%=intIdVersio n%>"
onclick="javasc ript:GetLangue( <%intIdVersion% >)"
class="texteBan deHaut"><font color="#990000" ><%=strVersion% ></font></a>
I liked to return my new version only when a user click on the top menu
where he have the possibility with this two language.

But for now all i received is an error messaor who tell me that there's an
error on the page.


Jul 19 '05 #3
And here's a good JavaScript board:

http://www.codingforums.com/forumdis...p?s=&forumid=2

Best regards,
J. Paul Schmidt, Freelance ASP Web Developer
http://www.Bullschmidt.com
ASP Design Tips, ASP Web Database Demo, Free ASP Bar Chart Tool...
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #4

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

Similar topics

2
9148
by: Kevin Lyons | last post by:
Hello, Can anyone assist me with what I am trying to do with the following code (six different scenarios to try to make the functionality work correctly)? I want to always (and ONLY) display in the status bar 'Symantec Corporation' whenever anyone mouses over (onMouseOver) my image or link OR when one clicks while holding the left mouse...
10
67734
by: Eric-Sebastien Lachance | last post by:
Hey there, I decided to just create a 100% height and width div that filled the space over a background header image, and add an onclick event to redirect to the my index... Doesn't seem to work in FireFox only, just in IE. Here's the code: <div id="headerimg"><div style="width: 100%; height: 100%; cursor: hand; cursor: pointer;"...
0
2231
by: Danny Patricia | last post by:
Hi How I can change this tag in order to works in NET? <a href="#" onclick="MyFolderProfile('<% =sFolder%>'); return false;" onmouseover="return ImageDown ('imgProfile', '<%if Mid(gsPageName,1,2) <> "ed" then Response.Write("My User Profile") else Response.Write("My Folder Setup") end if%>');" onmouseout="return ImageUp
9
3218
by: monomaniac21 | last post by:
hi all i want to use hyperlinks to 'load' content by changing the display of div tags. the problem i have is that unless i specify a href the anchor does not change the mouse pointer on hover even if display is set to block. it only look changes when there is a href there. but if i have a href there then when i click it will load the page,...
11
2407
by: jesdynf | last post by:
I'm having trouble applying a stylesheet to content I'm generating after the fact. Here's the sample code: <html> <head> <title>CSS/DOM Problem Example</title> <style type="text/css"> ..historylinks {
4
23260
by: jodleren | last post by:
Hi all I have a file I open in a smaller window, like this: <a href="#" onclick="window.open.... but it also causes the main window to jump to the top. What have people done to avoid that? BR
8
2239
by: Prisoner at War | last post by:
Another weekend, another project, another problem.... Why should a perfectly fine function work only half-way through when called through onClick in an anchor tag?? The text fade-in script below works when called through onLoad in the <bodytag, but it "hangs" when called through onClick in <a href="#">, as follows: <script...
5
2632
by: prathapavp | last post by:
hi all, We r working on ERP sys and am doing crossBrowser compatibility. The problem is am not able to load one function by onClicking the refrence text . could u please help me out.
8
4948
by: Dan Rumney | last post by:
All, I have a web page (copied below) with 3 images on it of fixed dimensions. Each image has a map associated with it In the maps, there are a number of areas with an onClick handler registered (in this sample, just an alert) The HTML is valid.
0
7396
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...
0
7805
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...
1
7413
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...
0
7751
tracyyun
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...
0
5968
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...
1
5323
isladogs
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...
0
3449
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...
0
3440
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
700
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...

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.