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

Assign a value to a Session variable from an Script

Hi,

I have a session variable wich value arrives from a previous .asp but
in my actual page I need to modify it based upon a selected value from
a radio button.

I will try to figure out for better understanding:

page1.asp ---session("PaymentMethod")
page2.asp ---Depending on the radio button selected the payment
method could be (check, transfer, creditcard) and this value must be
assigned to "PaymentMethod" session variable for further processing.

1.- In my form I created the hidden value:
<input type="Hidden" name="PaymentMethod" value="" id="PaymentMethod"
/>

2.- Radio buttons at the form

<input type="radio" checked name="btn_tipo_pago" value="1" >&nbsp;1.
Payment: Check</td>

<input type="radio" checked name="btn_tipo_pago" value="2" >&nbsp;1.
Payment: Transfer</td>

<input type="radio" checked name="btn_tipo_pago" value="3" >&nbsp;1.
Payment: Creditcard</td>

3.- Script to Identify wich button was selected as soon as the continue
button is pressed:
<SCRIPT FOR="continue" 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

4.- My questions are:
1.- From point (3) how may assign the sValue to my session variable
"Payment Method"

2.- How may I obtain and display through an alert the contents of
another session variable.
Thanks for your cooperation....

Aug 21 '06 #1
2 3387
1.- From point (3) how may assign the sValue to my session variable
"Payment Method"
Is there really any point in setting the session variable while you're still
in client-side script? Think about it, you can't use it yet in any ASP
code, because all you have is static HTML code and JavaScript sitting on the
client until they proceed to the next page... presumably, by submitting a
form, which could include their payment method, and which the processing
page could then save to a session variable.

Sure, there are kludges, but I fail to see what you gain by using them.
http://classicasp.aspfaq.com/general...de-script.html
2.- How may I obtain and display through an alert the contents of
another session variable.
<script>
alert("<%=Session("OtherSessionVariableName")%>");
</script>
Aug 22 '06 #2

Thanks...

Aug 22 '06 #3

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

Similar topics

2
by: spiderman | last post by:
How can one 'assign' value of a session variable to a variable, something like: temp = session("variable") Thanks
4
by: Terry | last post by:
I have a number of input boxes used to display totals based on selected items for each row in a table. There are more than a few rows that are identical, except for the form field name. I have...
2
by: selen | last post by:
I am using belove code.I want to send session's value a variable in another page. How can I take session value. script="<Language=VBScript> session(\"Id\")= ";
2
by: Garry Jones | last post by:
I have a web form to collect player data from team leaders. Problem 1 Each team leader may enter individual data for any ammount of others. Each time the form is submitted I am clearing the...
4
by: philin007 | last post by:
Hi , I have the following javascript codes: ****************************************** <script language="JavaScript"> <!-- .... ..... if (nextRow >5) {
1
by: Ranjan | last post by:
Hi, I want to assign javaScript variable to JSP variable. <Script> var conf=Confirm("Mess"); if(conf) { <% String str=conf; /// line 1 %> }
17
by: =?Utf-8?B?SmltIFJvZGdlcnM=?= | last post by:
I am trying to replace a huge chunck of code that currently I incorporate with an #Include directive. The program rarely has to flow through that code, so I thought it would be better if I used...
12
by: Kurda Yon | last post by:
I am wandering which way to assign a value to a session variable exist. Which of the following examples will work. Example #1: session_start(); session_register("ex"); $ex = 2.0; Example...
2
by: rahullko05 | last post by:
i am stuck in the problem, where after user logs in successfuly, i take him to the login thanks page. now on that page i need to retain the login name. I am not sure how to this. i have written a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.