473,562 Members | 2,650 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how pass option values to JS routine?

Hello,

The code below is an attempt to get an option value, word1 or word2,
into the requestInfo() javascript routine - but it isn't working -
why?!
<p>Select keyword:</p>
<p><input type="hidden" id="txtdef" value="" /></p>

<select name="txtdef">
<option value="word1">w ord1</option>
<option value="word2">w ord2</optionetc
</select>

<p><input type="button" value="Get definition" onclick="reques tInfo()"
/></p>

<div class="divdefIn fo"></div>

I am no doubt missing something obvious!?

Cheers

Geoff
Nov 18 '07 #1
2 2310
VK
On Nov 18, 6:16 pm, Geoff Cox <<>wrote:
<p>Select keyword:</p>
<p><input type="hidden" id="txtdef" value="" /></p>

<select name="txtdef">
<option value="word1">w ord1</option>
<option value="word2">w ord2</optionetc
</select>

<p><input type="button" value="Get definition" onclick="reques tInfo()"
/></p>
IMO comp.lang.javas cript is much more convenient place to ask such
questions; Followup set to comp.lang.javas cript is you need more help

onclick="reques tInfo()"
OK, but who will report the current selection to the function? ;-)

onclick="
requestInfo(
this.form.txtde f[this.form.txtde f.selectedIndex].value);"
Nov 18 '07 #2
On Sun, 18 Nov 2007 07:59:37 -0800 (PST), VK <sc**********@y ahoo.com>
wrote:
>On Nov 18, 6:16 pm, Geoff Cox <<>wrote:
><p>Select keyword:</p>
<p><input type="hidden" id="txtdef" value="" /></p>

<select name="txtdef">
<option value="word1">w ord1</option>
<option value="word2">w ord2</optionetc
</select>

<p><input type="button" value="Get definition" onclick="reques tInfo()"
/></p>

IMO comp.lang.javas cript is much more convenient place to ask such
questions; Followup set to comp.lang.javas cript is you need more help

onclick="reque stInfo()"
OK, but who will report the current selection to the function? ;-)

onclick="
requestInfo(
this.form.txtde f[this.form.txtde f.selectedIndex].value);"
thanks - working OK in IE but not Firefox! an onclick problem? have
posted in the javascript ng.

Cheers

Geoff
Nov 18 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
6290
by: Dan | last post by:
Can anyone offer suggestions on how to do this or if it is possible? I have a form that uses a drop down box and 2 text fields. What I am trying to do is have the value of each text box set by the choice from the drop down box. Something like: <form name="populatefrm" id="contactfrm" method="post"
4
11967
by: deko | last post by:
This is a basic program flow question. I'm trying to refractor an AC2000 app and split sections of code into separate modules. But there are a number of collections I create in one big module - containing file paths, Excel worksheet names, etc - I'm not sure how to pass these around, or if I'd be better off saving things to a table and...
2
2011
by: Martin McCormick | last post by:
Most of the C programming I write manipulates strings so I haven't had much experience with numerical functions and passing variables in and out which brings me to a laughably simple problem that I am having. How does one pass two unsigned longs in to a function that will ultimately do floating point calculations on them? A C tutorial I...
7
25153
by: ritchie | last post by:
Hi all, I am new to this group and I have question that you may be able to help me with. I am trying to learn C but am currently stuck on this. First of all, I have a function for each sort (Bubble, insertion, selection..). I have an array of int's and am passing them to each sort function.
7
5544
by: Morgan | last post by:
I have read much posts on the argument but no one clearly says if this operation is possible or not. Simply I have a routine which reads from a text file some integer arrays (1 or 2D). The first array in the file has known dimension, but it contains the dimensions (so unknown at compile time) of all the other arrays. So I can allocate...
13
2499
by: Shannon Richards | last post by:
Hello: I have a problem using ByRef arguments with Option Strict ON. I have built a generic sub procedure "ChangeValue()" to change the value of an argument if the new value is not the same as the original value...To accommodate all variable types I made the arguments in ChangeValue() of type object...I then check the typecode and do the...
19
9066
by: nazgulero | last post by:
Hello all, I wonder if anybody can give me a hint about what I have to do to get this working: I am creating a drop down box using the script below. The result is two text fields; now I want to pass those values, which come from the drop down box, to the next page. The next page should then simply look like this:
9
35430
by: skinnybloke | last post by:
Hi - I have 3 access queries which I run via 1 macro. Each of the queries now requires 2 parameters when they the run. The parameters are start and end dates. I have built the parameters into the queries but on running the macro I have to enter each of the dates 3 times - once for each query. Is there an easy way to ask for the...
0
1124
by: rn5a | last post by:
An ASP.NET app retrieves 3 columns named Product, Category & Price from a SQL Server 2005 DB table & displays them in a DataList. The headers of these 3 columns in the DataList are Product, Category & Price respectively. I want to give users the option to sort the items in the DataList. All the 3 columns can be sorted by clicking the...
0
7655
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7869
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
5477
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5193
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3623
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3608
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2073
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1191
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
903
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.