Solved

javascript if then

Posted on 2004-09-29
2
153 Views
Last Modified: 2010-04-01
hello

i would like to create a function that will look at the value from a text box and go to another page based on that value.

i would like to do it on page load.

so if text value = 1 go to another page else don't load another page.  

thanks
0
Comment
Question by:nito8300
2 Comments
 
LVL 4

Expert Comment

by:MacroLand
ID: 12180308
u may use jsp::forward tag in order to go another page

if {txt.value==1 ) jsp:forward

Take a look below link

http://java.sun.com/products/jsp/syntax/1.2/syntaxref1212.html
0
 
LVL 11

Accepted Solution

by:
sompol_kiatkamolchai earned 25 total points
ID: 12186479
Here is an example.

<html>
  <form name="form1">
    <input type="text" name="text1" value="1">
  </form>
  <script language="javascript">
    if(document.form1.text1.value = 1 ) {
      document.location = 'http://www.google.co.th';
    }
  </script>
</html>
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ajax auto save 15 101
reflection example 3 101
Multiple Images Upload [JSP Web-application] 3 38
approach on java challenges Approach on java challenges or real world challenges 29 160
FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

805 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question