473,405 Members | 2,415 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,405 software developers and data experts.

Loosing Session Values from script to script

The onclick action associated to my form´s radio buttons call to a
vbscript were the session values are changed, this happens correctly
but with the onclick action associated to my continue button always
shows the value =1 instead the values selected under my radio buttons
(Values= 4,3 or 1)

I am showing the code.

Ideas welcome.

Thanks....

1.- Radio Buttons:
<td width="58%" class="titulos2"><input type="radio" checked
name="btn_tipo_pago" value="3" >
<td width="58%" class="titulos2"><input type="radio" unchecked
name="btn_tipo_pago" value="4">
<tr><td class="titulos2"><input type="radio" unchecked
name="btn_tipo_pago" value="1" >

2.- Script for handling onclick event (shows the correct values
assigned at the radio button):

<SCRIPT FOR="btn_tipo_pago" EVENT="onclick" LANGUAGE="VBScript">
Dim oElement, oElements, oRadio
Dim sValue
set oElements = Document.frmdir.Elements
for each oElement in oElements
if oElement.Type= "radio" and oElement.Checked = True then
set oRadio = oElement
Exit for
End if
next
sValue = oRadio.value
************ IN sValue THERE IS THE VALUE OF THE RADIO BUTTON SELECTED
*************
if sValue=3 then
<%chk_pago=3%>
alert <%=chk_pago%>
<%session("tipo_pago") = chk_pago%>
alert("<%=Session("tipo_pago")%>")
else
if sValue=4 then
<%chk_pago=4%>
alert <%=chk_pago%>
<%session("tipo_pago") = chk_pago%>
alert("<%=Session("tipo_pago")%>")
else
if sValue=1 then
<%chk_pago=1%>
alert <%=chk_pago%>
<%session("tipo_pago") = chk_pago%>
alert("<%=Session("tipo_pago")%>")
else
alert "Error"
end if
end if
end if
</script>

3.- Continue button:
<a name="continuar" class="normal_sub" style="cursor:hand;">Finalizar
Compra</a>

4.- Script to check if the values assigned were correct (it´s
suppoused becase were show correctly on the last script, but it´s not
because always shows the "1" as value for both variable)

<SCRIPT FOR="continuar" EVENT="onclick" LANGUAGE="VBScript">
alert <%=chk_pago%
alert("<%=Session("tipo_pago")%>")
</script>

Aug 22 '06 #1
5 2128
Mirovk wrote on 22 aug 2006 in microsoft.public.inetserver.asp.general:
The onclick action associated to my formīs radio buttons call to a
vbscript were the session values are changed, this happens correctly
but with the onclick action associated to my continue button always
shows the value =1 instead the values selected under my radio buttons
(Values= 4,3 or 1)
[....]
>
<SCRIPT FOR="btn_tipo_pago" EVENT="onclick" LANGUAGE="VBScript">
Wait a minute - you're talking .NET aren't you?

This is a classic asp newsgroup. ASP.NET is totally different.

Try over at microsoft.public.dotnet.framework.aspnet.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Aug 22 '06 #2
Hi,
Yes this is classic ASP not .NET
If you can help me I will appreciatte.
Thanks,
Javier
Evertjan. ha escrito:
Mirovk wrote on 22 aug 2006 in microsoft.public.inetserver.asp.general:
The onclick action associated to my formīs radio buttons call to a
vbscript were the session values are changed, this happens correctly
but with the onclick action associated to my continue button always
shows the value =1 instead the values selected under my radio buttons
(Values= 4,3 or 1)
[....]

<SCRIPT FOR="btn_tipo_pago" EVENT="onclick" LANGUAGE="VBScript">

Wait a minute - you're talking .NET aren't you?

This is a classic asp newsgroup. ASP.NET is totally different.

Try over at microsoft.public.dotnet.framework.aspnet.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Aug 22 '06 #3
Mirovk wrote on 22 aug 2006 in microsoft.public.inetserver.asp.general:
Evertjan. ha escrito:
>Mirovk wrote on 22 aug 2006 in
microsoft.public.inetserver.asp.general:
The onclick action associated to my formīs radio buttons call to a
vbscript were the session values are changed, this happens
correctly but with the onclick action associated to my continue
button always shows the value =1 instead the values selected under
my radio buttons (Values= 4,3 or 1)
[....]
>
<SCRIPT FOR="btn_tipo_pago" EVENT="onclick" LANGUAGE="VBScript">

Wait a minute - you're talking .NET aren't you?
[please do not toppost on usenet]
Yes this is classic ASP not .NET
I doubt that. If so it does not work that way.

With classical ASP

if sValue=3 then
<%session("tipo_pago") = 3 %>
else
if sValue=4 then
<%session("tipo_pago") = 4 %>

an onclick [clientside!] action cannot do a serverside action,
like changing a session variable's value.
>This is a classic asp newsgroup. ASP.NET is totally different.

Try over at microsoft.public.dotnet.framework.aspnet.
If you can help me I will appreciatte.
Setting a session variable as a result of an onclick needs a trip to the
server, usually by submitting a <form>, [but could be don by AJAX, etc.]

I even doubt you can do the above in asp.net,
but that is not my experise,
and off-topic in this NG.

[btw: vbscript has "elseif",
which would help you simplifying your code,
by getting rid of the multiple "end if"s.]

[btw: clientside vbscript works only on IE.]

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Aug 22 '06 #4
Mirovk wrote:
sValue = oRadio.value
************ IN sValue THERE IS THE VALUE OF THE RADIO BUTTON SELECTED
*************
if sValue=3 then
<%chk_pago=3%>
alert <%=chk_pago%>
<%session("tipo_pago") = chk_pago%>
alert("<%=Session("tipo_pago")%>")
else
if sValue=4 then
ASP is stateless (all web technologoes are, for that matter):
http://en.wikipedia.org/wiki/Stateless_server

The server has no knowledge of client-side variables, and the client has no
knowledge of server-side variables. Those variables don't even exist at the
same time.

If you want to pass data from the client to the server, you must package it
into a request. The data can be carried in the querystring or in the request
headers (cookies or form POSTs).

To get data from the server to the client, you must write a complete
document that contains the data in a format that allows extraction.

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
Aug 22 '06 #5
Dave,
Thank you very much for your comments.

Aug 22 '06 #6

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

Similar topics

11
by: Sims | last post by:
Hi, I heard that there was a chance of 'loosing' a session ID between pages, (when the user clicks from one link to another). Is it really possible? Where could I find a definitive answer to...
1
by: Jonk Eidersteldvr | last post by:
Hi, I am using a web application -asp, ado, C#, using CodeBehind files etc.. I am using "InProc" session state and find that session variables are loosing their values between one web form and...
8
by: Radu Colceriu | last post by:
HI, I've an asp.net app like this: login.aspx (no frame) :- save in session the user and pass -> framedoc.html :- frameset 2 content 1. menu.aspx...
3
by: Windjammer | last post by:
I seem to be loosing my session variable as I move from one application to another The first application presents a menu of applications the user is authed for When I call the next application and...
9
by: Patrick | last post by:
Hello I'm running two Webservers Using ASP.NET. both are running the same ASP.NET Application, with <sessionState mode="SQLServer" stateConnectionString="tcpip=127.0.0.1:42424"...
3
by: David Lozzi | last post by:
Error: Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive at line 6 Line 4: <script RUNAT="SERVER"> Line 5: ...
15
by: cyndi_r2000 | last post by:
Hi Everyone: I have a web application running on .NET 2.0 under IIS 6.0 and users of this application seem to be loosing their session randomly - we havent been able to identify any pattern,...
2
by: Ned Balzer | last post by:
Hi, Apologies if this is a newbie question, I haven't found the answer in any faqs. I have an asp.net 2.0 page that sets session variables and then redirects to another page. For the page...
1
by: Owen Richardson | last post by:
I have an asp.net website where i have a quick search facility built into my master page. the search is a web control, with a drop down country box and a list box full of cities. When i select...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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...
0
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...
0
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,...

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.