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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

more help on drop down menus!

Status
Not open for further replies.

Rupa

Programmer
Jun 7, 2002
19
US
Hi again!! :)

I am still working on drop down menu thing and I am wondering if this is possible....

What I want to do is create a script that retrieves info from a table in Access without having to reload the page. I don't really know that much about JS so I'm not sure if this is easy/difficult or even if it's possible.

I want to take the VALUE selected by the user from the drop down menu, send that to the script, have the script retrieve a description of the value from a table, and then have the script return that value to another text box in the page. To make it a little more concrete, let me explain the page I'm creating. I have a form that deals with tools. The user is entering new tool information. When he chooses a tool number from the drop down menu, the description of that tool is supposed to immediately pop up in a text box labelled "Mold Tool." Both of these fields (as well as about 20 others) are then sent to a database. Right now I have it set up so that the description pops up in the "Mold Tool" text box but in this case the value of "Tool Number" is the description. This is a problem because the value needs to be the tool number so that it can be sent to the database. SO, what I want to do is have an additional table where a script can retrieve the description using the tool number. Does this make sense?

Tool Number: MT0001
(this is a drop down menu, here the user has chosen MT001)

The script takes this number and gets "blah blah 1" from the table.


Tool_Numbers_Table
__________________

MT0001 - blah blah 1
MT0002 - blah blah 2
etc


Mold Tool: [description "blah blah 1" pops up here]

Then the description pops up automatically.
Someone suggested some server-side scripting but to be completely honest I don't really know how to do that! [blush]

If anyone has any tips, I'd be forever grateful!

I'm off to [party] for the nite but I'll be checking in the morning. [morning]

Thanks!
Rupa [gorgeous]

(sorry about the smiley obsession....i'm still new to them!)
 
Hello Rupa,

I'm probably just as new to JavaScript as you... but I was browsing the web and found this website that might be of interest to you:
Earnie Eng - Newbie Access Programmer/DBA
If you are born once, you will die twice.
If you are born twice, you will die once
 
Thanks for the tip but that's not really what I'm looking for!

Any other suggestions?
 
If you are using asp then you can you use remote scripting, this is ideal for what you want to do.
 
No, it is not possible using client side JavaScripting. The Access file that you are mentioning will be residing in the server. The JavaScript itself gets executed on the client side (i.e. the browser). So, it has no means to get to the Access file on the server.

Server side scripting - is whatever runs on the server itself. It can be ASP, JSP, Perl, ColdFusion,.... A server side script is executed on the server and the result is pure HTML + JavaScript + DHTML etc which is sent to the browser.

Hope this helps.
Ganapathy
 
Rupa, Hi again...

This is a simple solution... example of ASP serverside script. It might not be the best, but it's what I came up with in my limited experience in scripting...

File called:
Code:
PullDownValueCapture.asp

Code:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
</head>

<body bgcolor=&quot;#FFFFFF&quot; text=&quot;#000000&quot;>
<form name=&quot;frmCategory&quot; method=&quot;post&quot; 
 action=&quot;PullDownValueCapture.asp&quot; target=&quot;_self&quot;>
  <table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; width=&quot;100%&quot;>
    <tr>
      <td width=&quot;8&quot;></td>
      <td><b><font face=&quot;Geneva, Arial, Helvetica, san-serif&quot; size=&quot;2&quot;>
       Select a Value:</font></b>
        <select style=&quot;font-family:Verdana, Arial;font-size:12;cursor:hand&quot; 
         name=&quot;SelectID&quot;>
          <option value=&quot;Selection 1&quot;>Selection 1</option>
          <option value=&quot;Selection 2&quot;>Selection 2</option>
          <option value=&quot;Selection 3&quot;>Selection 3</option>
        </select>
        <input style=&quot;font-family:Verdana, Arial;font-size:12;cursor:hand&quot; 
         type=&quot;submit&quot; name=&quot;Submit2&quot; value=&quot;Go&quot;>
      </td>
    </tr>
  </table>
</form>
Code:
<!-- being ASP Code -->
Code:
<% if request.ServerVariables(&quot;REQUEST_METHOD&quot;)=&quot;POST&quot; then %>
Code:
<p>The Value Selected is:
Code:
<%=request.Form(&quot;SelectID&quot;)%>
Code:
</p>
Code:
<% end if %>
Code:
</body>
</html>

Copy/Paste the code and give it a try... Earnie Eng - Newbie Access Programmer/DBA
If you are born once, you will die twice.
If you are born twice, you will die once
 
you guys ROCK! thanks a ton....for the info on client vs server-side scripting....
and for the script as well. i am using asp so that might help - althought i haven't tried it yet! my last day at this job is thursday so i'm probably not gonna tackle that part of the project but i'll give this info to the guy who is replacing me because i know he'll find it useful since he's not really familiar with asp either.

thanks again! [ponytails2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top