472,354 Members | 1,480 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,354 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 3333
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...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
1
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. header("Location:".$urlback); Is this the right layout the...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it so the python app could use a http request to get...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
0
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...

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.