Solved

javascript if then

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Direct mail marketing is the act of mailing materials straight to prospective customers. This wide form of marketing is one of the oldest methods of communicating with a geographic based demographic. So is it useful in 2017 and beyond?
No single Antivirus application (despite claims by manufacturers) will catch or protect you from all Virus / Malware or Spyware threats. That doesn't stop you from further protecting yourself however - and this article is to show you how.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
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…

679 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