codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Please help with the following problem  NewToScripting at 19:54 on Sunday, March 26, 2006
 

I want the following simple thing to work, but i can not make it work:
If a user enters "1" in the text box (name='user'), clicking the button should open Yahoo, other wise it should open Hotmail.

i dont know where the problem is, can anyone help me please?

this is the code:
-----------------------
<html>
<head>

<script LANGUAGE="JavaScript" type="type/javascript">

function Student()
{

if (document.theform.user.value==1)
{
document.open("http://www.hotmai.com");
}

if (document.theform.user.value!=1)
{
document.open("http://www.yahoo.com");
}

}

</script>
</head>
<body>

<form name = "theform">

Password:

<input type="text" name="user">



<input type="button" value="Enter Your Personal Page" onClick="Student()" >

</form>
</body>
</html>
-----------------------------


  Re: Please help with the following problem  miteshbhimjiyaani at 11:46 on Thursday, March 30, 2006
 

hi
use either
<script LANGUAGE="JavaScript" >
or
<script type="type/javascript">

it will work.








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  do static member are inherited
•  Re: Help with Using DataReader with StoredProcedure
•  Perl Script Output (w3c validator)
•  Re: HashMap question
•  focus management?
•  Looping Issue...Please help!
•  regarding hibernate
•  working with plugins
•  Checkbox Validation help.


Recent Articles
What is a pointer in C?
Multiple submit buttons with form validation
Understanding Hibernate ORM for Java/J2EE
HTTP screen-scraping and caching
a javascript calculator
A simple way to JTable
Java Native Interface (JNI)
Parsing Dynamic Layouts
MagicGrid
Caching With ASP.Net


© Copyright codetoad.com 2001-2006