Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I just dont understand this !!!.... advice sorely needed

Status
Not open for further replies.

DavidPook

Instructor
May 9, 2003
11
BR
Guys,

I am a noob. I admit it and i just cant get my head around it. Now, some of you will say.... dont bother then, but i am determined and WANT to understand why this is just not working for me.... here goes the questions......

I have a HTML page - on this page i have a drop down list of choices.

I have a .asp page that runs and works.

I have a .mdb that works..... to a point !


If i select an option on my drop down list, i then want the asp page to process this and write to my database. The fields:
name
dept
ext
all work fine and is processed and written to the database.
My drop down list does not write to the database.... the database field is blank.... on the database i have selected text and all that appears in this is a 0

i inserted this piece of code into my asp script, but does not work..... why ?

if request.form("Module 1 - Basic Concepts of IT") = "Module 1 - Basic Concepts of IT" THEN method="POST"

My apologies for not giving you perhaps all the information.... but if you need more... please ask, i really need to crack this one ASP (pardon the pun) as i have deadlines (like the rest of us)

Please help if you can...... Many thanks guys
[neutral]
 
Code:
if request.form("Module 1 - Basic Concepts of IT") = "Module 1 - Basic Concepts of IT" THEN method="POST"

I think this line of code is your problem... But, I'm not exactly sure what your trying to do...

On your html page,
Code:
method=post
, should be set in the form tags like this:
Code:
<form name=form1 method=post action=asppage.asp>

Then on your .asp page, you should request the values from the fields on your form... like this:
Code:
<%DropDownValue = request.form(&quot;DropDownFieldName&quot;)%>

I hope this helps... If not, post all of your code here and I'll take a look at it...

Later,
mwa
 
MORE INFO!!!!!

Known is handfull, Unknown is worldfull
 
Thanks mwa for your info, but still unable to write to the database.

Also thanks to vbkris as i thought i hadnt put enough info on the post !!!

Perhaps if you guys give me your email address i can send you my script and advise as necessary .... Many thanks if you can in advance.

My email address is:

david.pook@poole.nhs.uk

You will notice that i work for the NHS and we cant even afford a book on the subject.... how pants is that !!!!?

Thanks again guys, look forward to hearing from you

[rednose]

 
Ok, I believe the problem is going to be that select box as was mentioned above.
I doubt (but could be wrong) that the select box is named &quot;Module 1 - Basic Concepts of IT&quot;, let me explain:
Code:
<select name=&quot;MySelect&quot;>
<option value=&quot;0&quot;>First Entry</option>
<option value=&quot;1&quot;>Second Entry</option>
</select>

To correctly retrieve the value from the above drop down, we are going to ask for the value of MySelect:
Code:
Request.Form(&quot;MySelect&quot;)

To integrate this into an if statement:
Code:
If Request.Form(&quot;MySelect&quot;) = 0 Then ...

In your case I am willing to be that the string &quot;Module 1 - Basic Concepts of IT&quot; is your option text, but this would make a bad name for your select box.

Let me know if this is the issue, otherwise show the code forthe select box and we should be able to figure it out from there.

-Tarwn

01010100 01101001 01100101 01110010 01101110 01101111 01101011 00101110 01100011 01101111 01101101
29 3K 10 3D 3L 3J 3K 10 32 35 10 3E 39 33 35 10 3K 3F 10 38 31 3M 35 10 36 3I 35 35 10 3K 39 3D 35 10 1Q 19
Get better results for your questions: faq333-2924
Frequently Asked ASP Questions: faq333-3048
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top