Web development

Web development

I want to validate textbox based on dropdown menu consisting of many options. For eg Dropdown consists of option (1,2,3,4) if "1" is selected textbox should validate a value 0f "2300" through a submit button "Evaluate". Please give me the sample code for the above problem using only javascript

<HTML>
<SCRIPT>
function validate()
{
var v=document.getElementById("t").value;
var e = document.getElementById("sel");
var st = e.options[e.selectedIndex].text;
if(e=="" && v=="")
{
alert("Please fill in the options.");

}
else if(st=="1"&& v=="2300")
{
alert("Correct answer");

}
else 
{
alert("Incorrect answer");

}
}
}
</SCRIPT>
</HTML>
<form name="f" onsubmit="return validate();">
<pre>
<select id="sel">
<option value="0">Select an option</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>

Thanks for the code.. Worked well... According to the above code as soon as we select Evaluate button it shows alert box indicating Correct or Incorrect answer according to the input. But as we close the alert box the input values gets reseted to the original form. Can u please make the required modification? Also I want to implement a condition to show a alert box "Please fill in the option" when both or either of the inputs to drop down menu and textbox are missing. Please help me out with the code. Thank you

View Answers









Related Tutorials/Questions & Answers:
web development.
web development.  I have designed a website using asp.net in that i have used oracle as database,in that users can upload,view and edit their details.so,how to write code for edit,update and delete button in asp.net
Web development
Web development  I want to validate textbox based on dropdown menu consisting of many options. For eg Dropdown consists of option (1,2,3,4) if "1" is selected textbox should validate a value 0f "2300" through a submit button
Advertisements
Web development
Web development  Please help me formulate code for the following I have three textboxes.The first two textboxes has to carryout Addition or subtraction of two numbers entered and show the result in the third box as soon we take
Web development
Web development  I want to validate textbox based on dropdown menu consisting of many options. For eg Dropdown consists of option (1,2,3,4) if "1" is selected textbox should validate a value 0f "2300" through a submit button
Web development
Web development  I want to validate textbox based on dropdown menu consisting of many options. For eg Dropdown consists of option (1,2,3,4) if "1" is selected textbox should validate a value 0f "2300" through a submit button
Enjoying Web Development with Wicket
Enjoying Web Development with Wicket  Wanted e book Enjoying Web Development with Wicket 3rd edition
What is Web Development?
What is Web Development?  As a end user what arises in your mind. Like "What is Web development". Can any one explain with some examples. Thanks
web development trainee
web development trainee  How to store data and retrieve the stored data pleas give me details with examples
Ajax web development
Ajax web development  Hi, Why I should use Ajax frameworks in Ajax Web development? Thanks   Hi, Without the use of any Ajax framework you can also develop ajax based web applications. But the development effort
Web Development
Web Development Web development in general term is process... design, web content development, client-side/server-side scripting, and web server... for the web applications. Web Development Technologies Tutorials: HTML
Web Development for iPhone
Web Development for iPhone Developing Web apps for iPhone or any other mobile phone is a different task and not so easy as developing web apps..., an esteemed Delhi based software development company is quite capable of creating web
web component development
web component development  sir ineed objectives type questions
web component development
web component development  sir ineed objectives type questions
Web Portal - Development process
Web Portal  Could somebody tell us what common tools (and the cheaper ones) are in the market to develop a web portal? Say, if I want to develop a web portal, where people would post their comments and reviews; and others
Web-based system development
Web-based system development  I have a system written in java application.my lecturer asks me to do in web-base. what should i do?what should i have and what should i know? i have read that the best architecture is 3-tier
Web development - Introduction
Web development - Introduction       Web development in general term is process of developing... content development, client-side/server-side scripting, and web server
Web Page design and Development Company
Web Page design and Development Company We are web page designing... the world. Web page design and development is an art and skilled developers can create... complete web page design and development solution. Our company is expert
Web Application Development in India, Web Application Development
Web Application Development in India Develop your Web Applications in India... customised web application development services to you. With our industry..., MySQL, ASP, PHP, etc our web application development services are always tuned
PHP Web Development Company in India
PHP Web Development Company in India PHP is ultimate technology for developing.... If you are looking for PHP Web Development Company in India, then you have reached right place. We offer PHP Web Development Company in India at very cost
PHP Web Development Company in India
PHP Web Development Company in India PHP is ultimate technology for developing.... If you are looking for PHP Web Development Company in India, then you have reached right place. We offer PHP Web Development Company in India at very cost
PHP Web Development Company in India
PHP Web Development Company in India PHP is ultimate technology for developing.... If you are looking for PHP Web Development Company in India, then you have reached right place. We offer PHP Web Development Company in India at very cost
Summer Internship Program for Web Development and Web Design
Summer Internship Program for Web Development and Web Design - Rose India... looking to enroll in an internship program for web  development and web... and knowledge in web development and design beside introducing you with the latest
Web Development in India,Web Development in India Outsourcing
Web Development in India Web Development in India - Outsource Web Development in India Web Development and designing is a highly structured work due... attract user at once. Rose India is a Web Development Company in India
Web Application Development,Web Application Development India
Web Application Development Solutions India Web Application Development... web application development solutions that are reliable, scalable and robust. Rose India offers the following Web Application Development Solutions
SWeDE: Semantic Web Development Environment
SWeDE: Semantic Web Development Environment       The Semantic Web Development Environment... for the Semantic Web. The toolkit, built on the Eclipse IDE includes an OWL editor
Ajax as Web application Development
Ajax as Web application Development       AJAX is a web application development technique which... by XML tools. CSS: CSS (Cascading Style Sheet) is used in web site for designing
JSF most popular web application development framework
development, specially creating user interfaces for the web applications. You can... to the JSF technology, reasons that initiated the development of JSF framework and benefits of using JSF. The problems occurring during the development
Top 10 Web Development Languages
Top 10 Web Development Languages For a web designer or a web developer a grasp on few most crucial web development languages is a must as they are the very materials of their web development project. While some of these web development
Java web development, what skills do I need?
Java web development, what skills do I need?  Java web development, what skills do I need
Java web development, what skills do I need?
Java web development, what skills do I need?  Java web development, what skills do I need
whent to use web server - Development process
whent to use web server  Web Server ->we can run only servlets jsp and html pages but not EJB'S.but it is possible in App server. web server... question is when to use web server
regarding designing of web search engine - Development process
regarding designing of web search engine  we want to design a web search engine in java. so, how to get started with our coding...can i get sample code for web crawlers or similar requirements... help us
Symfony Framework for PHP Web Application Development
Symfony Framework for PHP Web Application Development Symfony is the most crucial framework for PHP web application development, which is distributed under... open source or commercial web application development. Symfony Framework has
Brief Introduction to the Web Application development
Brief Introduction to the Web Application development Gone are the days... tutorial assumes that you are already familiar with Web concepts such as HTTP, browsers, and Web Servers as well as the Java programming
Web Development Services,Web Design Development Services,Website Developement Services India
Web Development Services RoseIndia.net is a specialize software firms.../server platform as well as web domain. First of all we do study and understand.... We follow the following steps of software development process
Top 10 Web Development Skills You Need
conversion comes. To talk about top 10 web development skills you need we face... preferred web development skills. SEO SEO or search engine optimization... going to acquire other web development skills. HTML 5, the latest version
Key Reasons to Use Angular for Web App Development
AngularJS Tutorials: Key Reasons to Use Angular for Web App Development Years... of development projects. Since then, AngularJS continued to evolve and become richer... development Angular offers a complete package of tools and all required features
Top 10 Web Development Skills
Top 10 Web Development Skills For an ambitious web developer or web designer... in career as a developer or designer. To talk of top 10 web development skills we... of internet access. Web development skills of highest demand went through multiple
CakePHP Framework for PHP Web Application Development
CakePHP Framework for PHP Web Application Development CakePHP is an open source PHP Framework for web application development that is released under MIT... Mapping. Using this framework you can develop robust and high level Web
Offshore Web Application Development Can Be Advantageous
Offshore Web Application Development Can Be Advantageous The problem.... This is where an offshore web application development service may end up making all... this service to work. An offshore web application development service will be used
J2EE Web Service Development with Attachments Using Axis
J2EE Web Service Development with Attachments Using Axis... the development of a java web service that takes DIME or MIME attachment as input... have a basic understanding of J2EE web service development. Introduction
Flex Offshore Web Development
Flex Offshore Web Development Adobe Flex is a flexible and powerful standards.... We offer Flex Offshore Web Development service including Custom E-Commerce... Development, Database Driven Flex Applications, Web banners, Animated flash
Flex Web Development
Flex Web Development With the growth the internet technology and web world... Flash platform, web pages have gained great changes in outlook, design... development kit used for developing an interactive cross-platform rich Internet
Web Application Development Getting Started
Web Application Development – Getting Started Web applications... application or if you just want to know more about web application development here... start the web application development. You as the programmer or web developer
Traditional Means of Web Application Development
Traditional Means of Web Application Development       In the early days the web pages were static, simple HTML web pages, later on it became dynamic by using CGI script (Perl
Software Development company, Software Development
development company playing a lead role in providing Web based Software Development... Software JSF Software Development Services Roseindia is one of the renowned online publishing and software development companies. We
Eclipse Plugin- J2EE Development Platform
generation Web Integrated Development Environment (Web IDE) based o­n Eclipse... Eclipse Plugin- J2EE Development Platform       Lomboz-Development
Indian Software Development Company
playing a lead role in providing Web based Software Development Solutions and Support Services in India including Website Designing and Development, Web Promotion..._TO_REPLACE_9 (iii) Website Designing and Web Development Web Design
Web Performance Analyzer
Web Performance Analyzer       Web Performance Analyzer Web Performance Analyzer takes the guesswork out of web page development! This new development tool enables
Struts 2 in Agile Development Environment
efficiency and effectiveness. Struts 2 support for Agile web application development...Struts 2 in Agile Development Environment This article explains you how Struts 2 can be used in Agile Development environment. Struts 2 fully supports Agile

Ads