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

How to display answers based on drop down selection?

I have a drop down selection menu on an HTML form.

I want to display 1 answer, for a few selection options.... and another answer for the rest of the options.

Example code is below:

Expand|Select|Wrap|Line Numbers
  1. How Much Are You Worth In Total Assets (Savings, Equity, Stocks, 401K, Car, Home, Anything of Value, etc...)?
  2.   <select name="assets">
  3.     <option value="$0 - $15K">$0 - $15K</option>
  4.     <option value="$15K - $50K">$15K - $50K</option>
  5.     <option value="$50K - $100K">$50K - $100K</option>
  6.     <option value="$100K - $200K">$100K - $200K</option>
  7.     <option value="$200K - $400K">$200K - $400K</option>
  8.     <option value="$400K - $700K">$400K - $700K</option>
  9.     <option value="$700K - $1M">$700K - $1M</option>
  10.     <option value="$1M+">$1M+</option>
  11.   </select>
  12.  
Those would be the choices. Now here is my PHP code... I cannot get it work.

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. if ($answer=="$variable1, $variable2, $variable3, $variable4, $variable5, ($assets == $0 - $15K || $assets == $15K - $50K)")
  3. echo "You should consider getting $100000K in coverage";
  4.  
  5. etc..etc...
  6.  
I want to display the answer here, if they picked either of those 2 asset options (in the string). What am I doing wrong?
Oct 22 '10 #1
0 1249

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

Similar topics

0
by: ALI | last post by:
hi i need some best answer's for this question for interview as an oracle (DBA). Q : what is the most difficult situation u faced and how did u solved it ???? i really appriciate if some...
5
by: Vandana Rola | last post by:
Hello Everyone, I am a beginner in Javascript.I want to create fun quiz tool using javascript (no database). The feature of that tool is every question has five choices. The user needs to select...
2
by: Ray | last post by:
I just have a brief idea of this approach and would like to hear a few words from experts here. I have medium level of programming in Access. In fact, I would like to build a simple database to...
2
by: Rik Brooks | last post by:
My boss has put a couple of restraints on me that has me tearing out my hair. Here is my problem. On a particular asp page I need to use server side controls so that I do some fairly complex...
16
by: C++ Hell | last post by:
Hey everyone just designing a quiz for school and managed to write the code for the questions and answers thou i have to add scores and at the end an overall score does anyone have any idea what to...
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
0
by: Night Air | last post by:
I have problem with a website that collects user responses to multiple choice questions. The users choose and value from a Radio Button, then click on a Next button to go the next page. The...
2
by: Gq | last post by:
I need a short script for multiple video play on my space,, if possible - ( PHP or java, or even HTML.) can anyone help me ? Thanks
5
by: pefok | last post by:
Hello everyone, One of my course works is to implement a java based quiz system. the program consists of two modules one for the teacher to create, set questions , answers and the number of...
7
mb60
by: mb60 | last post by:
sir In my database I have one column for question. Four columns are meant for options 1,2,3,4. The 5th column is YES/NO column. The answers for the questions are entered into 5th column by a...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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,...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.