Solved

javascript if then

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Short answer to this question: there is no effective WiFi manager in iOS devices as seen in Windows WiFi or Macbook OSx WiFi management, but this article will try and provide some amicable solutions to better suite your needs.
A safe way to clean winsxs folder from your windows server 2008 R2 editions
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

706 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

20 Experts available now in Live!

Get 1:1 Help Now