473,320 Members | 1,884 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Shouldn't this work ? ...

I'm not very good at js, so I'm guessing that I definitely have something
wrong here ...
<head>
<script language="JavaScript">
function testFunc(form){
var tmp1 =
document.form.site.options[document.form.site.selectedIndex].value;
document.write tmp1
}
</script>
</head
.... <form method='post' name='form'>
<select name="site" onChange="javascript:testFunc(this)">
<option value='#'>--- (Select Site) ---
(there is a list here of <option value=".... > that is called
from a db)
</select>

Anyway, nothing is happening onChange
Where have I gone wrong?????
Jul 23 '05 #1
3 1059
In article <LT*******************@bignews4.bellsouth.net>,
rl*****@energymasterllc.com says...
I'm not very good at js, so I'm guessing that I definitely have something
wrong here ...
<head>
<script language="JavaScript">
function testFunc(form){
var tmp1 =
document.form.site.options[document.form.site.selectedIndex].value;
document.write tmp1
}
</script>
</head
... <form method='post' name='form'>
<select name="site" onChange="javascript:testFunc(this)">


You don't need the "javascript:" in the onChange event for starters, and
your document.write statement should be
document.write (tmpl);

--
Hywel I do not eat quiche
http://kibo.org.uk/
http://kibo.org.uk/mfaq.php
Jul 23 '05 #2
thanks. Silly mistake, really.

"Hywel" <hy**********@hotmail.com> wrote in message
news:MP************************@news.individual.ne t...
In article <LT*******************@bignews4.bellsouth.net>,
rl*****@energymasterllc.com says...
I'm not very good at js, so I'm guessing that I definitely have something wrong here ...
<head>
<script language="JavaScript">
function testFunc(form){
var tmp1 =
document.form.site.options[document.form.site.selectedIndex].value;
document.write tmp1
}
</script>
</head
... <form method='post' name='form'>
<select name="site" onChange="javascript:testFunc(this)">


You don't need the "javascript:" in the onChange event for starters, and
your document.write statement should be
document.write (tmpl);

--
Hywel I do not eat quiche
http://kibo.org.uk/
http://kibo.org.uk/mfaq.php

Jul 23 '05 #3
Hywel wrote on 14 apr 2004 in comp.lang.javascript:
In article <LT*******************@bignews4.bellsouth.net>,
rl*****@energymasterllc.com says...
I'm not very good at js, so I'm guessing that I definitely have
something wrong here ...
<head>
<script language="JavaScript">
function testFunc(form){
var tmp1 =
document.form.site.options[document.form.site.selectedIndex].value;
document.write tmp1
}
</script>
</head
... <form method='post' name='form'>
<select name="site" onChange="javascript:testFunc(this)">


You don't need the "javascript:" in the onChange event for starters,
and your document.write statement should be
document.write (tmpl);


And you cannot do a document.write in an onchange without destroying the
whole page.

Do an alert(tmp1) or a mydiv.innerHTML = tmp1
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 23 '05 #4

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

Similar topics

6
by: Tom D. | last post by:
I just got a new computer. I transfered my web site files over and setup my access database system ODBC driver. I've compared settings on both computers. But when I run my web site code on new...
0
by: Ben Margolin | last post by:
I am new to subselects, and what I really want is to do them in an update, but the following shows a simpler select, that also doesn't seem to work as I think it should. Advice? Do I just...
0
by: Daniel Weber | last post by:
Hi! In my code I create a CryptoStream around another stream of my own, with CryptoStreamMode.Read. So I just can read from the CryptoStream. When I close that CryptoStream, however, the...
12
by: ORC | last post by:
Shouldn't 'ReadFile' block when timeouts are specified even when running in overlapped mode or am I wrong ??? Thanks Ole
3
by: Paul | last post by:
Hi I am setting a boolean value to true on a page and writing the results to viewstate Just above the web form designer generated code I have Dim bps_found As Boolean 'visible to this module in...
1
by: FishKeeper | last post by:
I'm trying to write JavaScript code to test whether cookies are enabled by writing a cookie and then reading its value. My code works fine in Firefox, but it's not working in Internet Explorer 6. ...
4
by: Joe Van Dyk | last post by:
The FAQ at http://www.parashift.com/c++-faq-lite/exceptions.html#faq-17.6 says that you shouldn't throw built-in exceptions. I'm not sure why I shouldn't throw something like std::domain_error...
28
by: Jess | last post by:
Hello, It is said that if I implement a "swap" member function, then it should never throw any exception. However, if I implement "swap" non- member function, then the restriction doesn't...
2
by: year1943 | last post by:
There was the same topic not so long ago, but as I see it stays w/o answer:...
4
by: Damjan | last post by:
There are several attempts to allow python to work with per user (or even per session) 'site-packages' like virtualpython / workingenv / virtualenv. But they all have their own shortcomings and...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.