Solved

javascript if then

Posted on 2004-09-29
2
152 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
form submissions on a web page 2 143
web service Rest Client creation 4 81
EJB MDB example 4 79
servlet example 17 5
Large Outlook files lead to various unwanted errors and corruption issues. Furthermore, large outlook files can also make Outlook take longer to start-up, search, navigate, and shut-down. So, In this article, i will discuss a method to make your Out…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

895 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now