javascript if then

Posted on 2004-09-29
Medium Priority
Last Modified: 2010-04-01

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.  

Question by:nito8300

Expert Comment

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

LVL 11

Accepted Solution

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

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

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

The article describes step by step how to validate the SRA software certificate once installed on the Site Recovery Manager server. I hope it will be very useful for all administrators of virtualized environments.
In this article, we will discuss how you can secure Active Directory using free tools, and how you can choose a safe and secure Active Directory security auditing tool.
The video provides a quick and easy steps to migrate MBOX file to well known Outlook PST and Office 365. Besides this, it also supports and migrates more than 20 email clients of MBOX which include AppleMail, Opera, Thunderbird and SeaMonkey effortl…
Watch the video of Kernel Migrator for SharePoint, which demonstrate the process easily of migration from SharePoint to SharePoint, OneDrive for Business & Google Drive servers, Public Folder to SharePoint, File Server to SharePoint. The tool has va…

622 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