|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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"> </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 |
|
#2
|
|||
|
|||
|
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. |
|
#3
|
|||
|
|||
|
Thanks for your help but I tried it and it did not work.
Any other suggestions? |
|
#4
|
|||
|
|||
|
Change the first line in your form from:
Code:
<form action="calc12.asp" method="get"> to Code:
<form action="calc12.asp" method="post"> |
|
#5
|
|||
|
|||
|
I have changed the method to post and still nothing happened do you have any other suggestions?
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > Asp form |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|