Closed Thread
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-08-2009, 03:08 PM
Member
 
Join Date: Feb 2009
Posts: 1
Rep Power: 0
robjames is on a distinguished road
Default Basic Help
Hi Guys,

I'm hoping this is a basic thing for you guys but im very new to Java.
I got the below script given to me and although it works locally, i cant get it to work when uploaded.

I'm assuming that its because all the other links on my site work in relation to each other where as this seems to try and load success.html and failure.html differently.

Would really appreciate any help you can offer. The Script is below.

Many Thanks

Rob




<form>
<p align="center"><span class="style3">ENTER USER NAME :
</span>
<input type="text" name="text2">
</p>
<p align="center"> <span class="style3">ENTER PASSWORD :</span>
<input type="password" name="text1">
<input type="button" value="Check In" name="Submit" onclick=javascript:validate(text2.value,"wessex",t ext1.value,"hibernia") >
</p>

</form>
<script language = "javascript">

function validate(text1,text2,text3,text4)
{
if (text1==text2 && text3==text4)
load(a href="success.html");
else
{
load(a href="failure.html");
}
function load(url)
{
location.href=url;
}
</script>
Bookmark Post in Technorati
  #2 (permalink)  
Old 02-08-2009, 04:25 PM
CJSLMAN's Avatar
Moderator
 
Join Date: Oct 2008
Location: Mexico
Posts: 1,160
Rep Power: 3
CJSLMAN is on a distinguished road
Default Java...
robjames... this is a Java development forum... not a Javascript forum. The two are different. For example, in java, the follwing is wrong:
Code:
if (text1==text2 && text3==text4)
In Java you don't compare strings with "=="... you use the string method "equals()". I don't know what is used for comparing strings in Javascript.
Also check the paring of curly brackets "{}"... I count 3 opening brackets and only two closing brackets.

Luck,
CJSL
__________________
Chris S.
Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.
Bookmark Post in Technorati
  #3 (permalink)  
Old 02-08-2009, 08:46 PM
Senior Member
 
Join Date: Dec 2008
Posts: 192
Rep Power: 2
Webuser is on a distinguished road
Default
Sometimes people really confuse these two things as Java or JS ((( That's a pity (
Bookmark Post in Technorati
  #4 (permalink)  
Old 02-09-2009, 03:58 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 7,446
Rep Power: 11
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
Default
robjames, as CJSLMAN explain in his last post this, is a Java forum. Not a JavaScritp forum. It's better to ask your question on relevant JS forum. I've close this thread. If you have any further questions on this thread contact me through PMs.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
Someone helped you? their helpful post.
Help:Forums FAQ|How To Ask Questions The Smart WayResources:The Java Tutorials|Glossary for Java|NetBeans IDE|Sun DownloadsWeb:WritOnceTips:Is your IDE the best?|Which Application Server?
Bookmark Post in Technorati
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need some really basic help Mayur New To Java 6 01-24-2009 07:00 AM
inheritance basic. newmember New To Java 1 08-02-2008 10:35 PM
basic java help adred New To Java 0 03-08-2008 01:36 PM
Basic Program Please Help!! VinceGuad New To Java 3 02-01-2008 04:35 PM
help with basic example fred New To Java 1 07-20-2007 06:45 PM


All times are GMT +2. The time now is 05:57 PM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org