| We hope you enjoy your visit. You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you're already a member please log in to your account to access all of our features: |
- Pages:
- 1
- 2
| JavaScript: Changing a variables value based; on the selection in a drop-down list | |
|---|---|
| Tweet Topic Started: Jun 16 2005, 07:26 PM (1,277 Views) | |
| solinent | Jun 30 2005, 11:42 AM Post #16 |
|
Member
![]() ![]() ![]() ![]() ![]()
|
I still don't fully understand. That script will give you a random one, but you can change the second number, depending on the first(so if you had a forumula for the first related to the second.) If you want to random specific numbers than ask me. |
![]() |
|
| Postulate-ZNS | Jun 30 2005, 11:57 AM Post #17 |
|
I am, therefore I think: Descartes can shove it
![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
That last script gave two variables, and the second was 10 times greater than the first, because of the "*10" statement. I don't want the numbers to be random, just two different numbers with no mathematical relation to each other to display on two seperate text inputs based on the selection in a single list. Example: There is a selection list with two options: "Pizza" and "Cheese." When Pizza is selected, the two text fields beside the list display the numbers "7,10" respectively. When Cheese is selected, these numbers both change. The text fields now show "23,4." The two sets of numbers--23/4 and 7/10, have no relation to each other, and are completely seperate, but not random. They have been clearly defined. If you were to select the option again, the same numbers would display. Does that make sense now? :/ Thanks again. |
![]() |
|
| solinent | Jul 4 2005, 10:05 PM Post #18 |
|
Member
![]() ![]() ![]() ![]() ![]()
|
Well, it can be done, I'll give you a code(might take me like 1 min, but I gotta go now, so just wait till tommorow.) And what purpose do you have of this anyways? From what I see, if you wanted to just display the variables you could just set the value of the select tag: <select value="0, 3">Click me to make the input tag change value!!!!! So cool!!!</select> Anyways, if you need to set each number in a variable to be used in a javascript, then there's another way. Just tell me if you need further, as I REALLY gotta go... |
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| « Previous Topic · Technology Chat · Next Topic » |
- Pages:
- 1
- 2
| Track Topic · E-mail Topic |
9:10 AM Jul 11
|



![]](../../../../0/1/0/p601690/pipright.png)



9:10 AM Jul 11