473,386 Members | 1,644 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,386 software developers and data experts.

How to get value of dropdown option with javascript?

Expand|Select|Wrap|Line Numbers
  1. <SCRIPT language=JavaScript>
  2.     function reload(form)
  3.     {
  4.         var origin=form.from.options[form.from.options.selectedIndex].value;
  5.         self.location= + origin ;
  6.     }
  7. </script>    
  8. //////and then heres the form it is on////
  9. echo "<select name='from' onchange=\"reload(this.form)\"><option value=''>Select one</option>";
  10.  
  11.         foreach ($tripdetail_query as $qorigin)
  12.             {
  13.                 echo "<option value='".$qorigin['From']."'>".$qorigin['From']."</option>";
  14.  
  15.             }
  16.         echo "</select>". '     to     ';
but problem is that origin gets the NaN value. whats up?
Feb 9 '11 #1
1 1619
Dormilich
8,658 Expert Mod 8TB
= + origin ; => implicit type conversion to Number. you probably mean += origin;
Feb 9 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Terry | last post by:
I've tried and tried, and thought I had it figured out, but still the results indicate that I'm wrong. Help is appreciated. I'm merely trying to grab a value from a form and insert it into a...
1
by: maheshvd | last post by:
Hi all, If I change the selected value of a dropdown server control on client side, is there any way to force the serverside Selectedindexchanged event? (if the user clicks on the dropdown and...
3
daJunkCollector
by: daJunkCollector | last post by:
I have the html/javascript posted below, I imagine the fix to my problem is something simple that I am overlooking. My script is a little bit of html and javascript, and there is an embedded flash...
2
by: rpeterson84 | last post by:
Hi, Thanks in advance to for the help!!!!! When the page loads, "Application Inventory" is selected by default --- I want to use a mouse.click to select "Systems Compliance", BUT HOW? I'm...
3
by: farukcse | last post by:
Hi, Can any one tell me how to assign a php variable value using ajax / javascript? Regards, Faruk Chowdhury
2
by: sabrinakr | last post by:
Hi All, I have spent a long time on this and still cant figure out whats wrong. I have recently started with javscript and my question is as follows: The page works fine but if the User...
3
by: Yonih | last post by:
Hey Everyone, I was hoping someone could help me here. I need a way to have a drop down that when selected it can keep a value and display it below here is an example. A drop down list of...
2
by: rahullko05 | last post by:
i am stuck in the problem, where after user logs in successfuly, i take him to the login thanks page. now on that page i need to retain the login name. I am not sure how to this. i have written a...
1
by: kanishka1213 | last post by:
#!/activeperl/perl/bin/perl use CGI qw(:standard); print "Content-type: text/html\n\n"; print <<EndOfHTML; <html> <head> <script language="javascript" type="text/javascript">
10
by: Vivekneo | last post by:
Hi I am very new to web programming, trying to achieve a task, I have a form with 3 dropdown box and a text field(which is readonly). My problem now is, after selecting the above 3 dropdown boxes,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.