ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old April 13th, 2009, 02:06 AM
skotadi skotadi is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2009
Posts: 3 skotadi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 36 m 31 sec
Reputation Power: 0
Exclamation Asp form

Hi, I am new at asp and I don't know much about programming. I am trying to create a form that does some calculations. I am using dreamweaver and i have inserted a list/menu in my form but i can't connect the values from the form with the source code. What I have done is this:

<form action="calc12.asp" method="get">
<table width="820" height="291" border="1">
<tr>
<th width="140" scope="col">&nbsp;</th>
<th width="664" scope="col">Υπολογισμός</th>
</tr>
<tr>
<th height="112" scope="row"><label for="select"></label>
<select name="deiktes" id=Select1>
<option value="noneSelected"> Λίστα Επιλογής </option>
<option value="Ενεργό πλάτος λεκάνης απορροής"
<% if deiktes="Ενεργό πλάτος λεκάνης απορροής" then response.write("SELECTED") %> > Ενεργό πλάτος λεκάνης απορροής</option>
<option value="Αδιάστατος Δείκτης Κυκλικότητας RC"
<% if deiktes="Αδιάστατος Δείκτης Κυκλικότητας RC" then response.write("SELECTED") %> > Αδιάστατος Δείκτης Κυκλικότητας RC</option>
<option value="Αδιάστατος Δείκτης Επιμήκυνσης"
<% if deiktes="Αδιάστατος Δείκτης Επιμήκυνσης" then response.write("SELECTED") %> > Αδιάστατος Δείκτης Επιμήκυνσης</option>
<option value="Αδιάστατος Δείκτης Συμπαγούς"
<% if deiktes="Αδιάστατος Δείκτης Συμπαγούς" then response.write("SELECTED") %> > Αδιάστατος Δείκτης Συμπαγούς</option>
<option value="Πυκνότητα υδρογραφικού δικτύου"
<% if deiktes="Πυκνότητα υδρογραφικού δικτύου" then response.write("SELECTED") %> > Πυκνότητα υδρογραφικού δικτύου</option>
<option value="Συντελεστής ελικτότητας κυρίου υδατορρεύματος"
<% if deiktes="Συντελεστής ελικτότητας κυρίου υδατορρεύματος" then response.write("SELECTED") %> > Συντελεστής ελικτότητας κυρίου υδατορρεύματος</option>
</select></th>
<td><p class="asp">
<label for="varA"></label>
<input type="text" name="varA" id="varA">
</p>
<p class="asp">
<label for="varB"></label>
<input type="text" name="varB" id="varB">
</p></td>
</tr>
<tr>
<th height="122" class="asp" scope="row"><input type="submit" name="Submit" id="Submit" value="Submit"></th>
<td class="asp"><label for="theAnswer"></label>
<label for="theAnswer"></label>
<input type="text" name="theAnswer" id="theAnswer"></td>
</tr>
</table>
</form>
That is the code of the form.

<%
theVarA = Request.Querystring("varA")
theVarB = Request.Querystring("varB")
thedeiktes = Request.Querystring("deiktes")
%>

<%
if thedeiktes = "Ενεργό πλάτος λεκάνης απορροής" then theAnswer = theVarA / theVarB
if thedeiktes = "Αδιάστατος Δείκτης Κυκλικότητας RC" then theAnswer = ((4*3.14*theVarA) / (theVarB*theVarB))
if thedeiktes = "Αδιάστατος Δείκτης Επιμήκυνσης" then theAnswer = ((2/theVarA) * (sqr(theVarB) / 3.14))
if thedeiktes = "Αδιάστατος Δείκτης Συμπαγούς" then theAnswer = ((0.282 * (theVarA)) / sqr(theVarB))
if thedeiktes = "Πυκνότητα υδρογραφικού δικτύου" then theAnswer = theVarA / theVarB
if thedeiktes = "Συντελεστής ελικτότητας κυρίου υδατορρεύματος" then theAnswer = ((4*3.14*theVarA) / sqr(theVarB))
%>



<body bgcolor="#C0DFFD">
<%Response.Write "theAnswer"%>





</body>
And that is the asp code
Please help me if possible.Thanks in advance

Reply With Quote
  #2  
Old April 13th, 2009, 09:20 AM
Ronster Ronster is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2007
Location: Charlotte
Posts: 237 Ronster User rank is First Lieutenant (10000 - 20000 Reputation Level)Ronster User rank is First Lieutenant (10000 - 20000 Reputation Level)Ronster User rank is First Lieutenant (10000 - 20000 Reputation Level)Ronster User rank is First Lieutenant (10000 - 20000 Reputation Level)Ronster User rank is First Lieutenant (10000 - 20000 Reputation Level)Ronster User rank is First Lieutenant (10000 - 20000 Reputation Level)Ronster User rank is First Lieutenant (10000 - 20000 Reputation Level)Ronster User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Days 10 h 53 m 8 sec
Reputation Power: 126
The problem is that you are using

Code:
Request.QueryString()


but you are not passing the variables as query strings. Query Strings are useful in OTHER situations, but not here... in this case you have direct access to the variables.

I think all you need to do is change the Request.QueryString()
to:

Code:
Request()


and you'll be good.

Reply With Quote
  #3  
Old April 13th, 2009, 09:53 AM
skotadi skotadi is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2009
Posts: 3 skotadi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 36 m 31 sec
Reputation Power: 0
Thanks for your help but I tried it and it did not work.
Any other suggestions?

Reply With Quote
  #4  
Old April 13th, 2009, 03:54 PM
Ronster Ronster is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2007
Location: Charlotte
Posts: 237 Ronster User rank is First Lieutenant (10000 - 20000 Reputation Level)Ronster User rank is First Lieutenant (10000 - 20000 Reputation Level)Ronster User rank is First Lieutenant (10000 - 20000 Reputation Level)Ronster User rank is First Lieutenant (10000 - 20000 Reputation Level)Ronster User rank is First Lieutenant (10000 - 20000 Reputation Level)Ronster User rank is First Lieutenant (10000 - 20000 Reputation Level)Ronster User rank is First Lieutenant (10000 - 20000 Reputation Level)Ronster User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Days 10 h 53 m 8 sec
Reputation Power: 126
Change the first line in your form from:

Code:
<form action="calc12.asp" method="get">


to

Code:
<form action="calc12.asp" method="post">

Reply With Quote
  #5  
Old May 12th, 2009, 10:43 AM
skotadi skotadi is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2009
Posts: 3 skotadi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 36 m 31 sec
Reputation Power: 0
I have changed the method to post and still nothing happened do you have any other suggestions?

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Asp form


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
Stay green...Green IT