Results 1 to 4 of 4
Thread: Basic Help
- 02-08-2009, 02:08 PM #1
Member
- Join Date
- Feb 2009
- Posts
- 1
- Rep Power
- 0
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>
- 02-08-2009, 03:25 PM #2
Java...
robjames... this is a Java development forum... not a Javascript forum. The two are different. For example, in java, the follwing is wrong:
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.Java Code:if (text1==text2 && text3==text4)
Also check the paring of curly brackets "{}"... I count 3 opening brackets and only two closing brackets.
Luck,
CJSLChris S.
Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.
- 02-08-2009, 07:46 PM #3
Senior Member
- Join Date
- Dec 2008
- Posts
- 526
- Rep Power
- 0
Sometimes people really confuse these two things as Java or JS ((( That's a pity (
- 02-09-2009, 02:58 AM #4
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
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.
Similar Threads
-
Need some really basic help
By Mayur in forum New To JavaReplies: 6Last Post: 01-24-2009, 06:00 AM -
inheritance basic.
By newmember in forum New To JavaReplies: 1Last Post: 08-02-2008, 09:35 PM -
basic java help
By adred in forum New To JavaReplies: 0Last Post: 03-08-2008, 12:36 PM -
Basic Program Please Help!!
By VinceGuad in forum New To JavaReplies: 3Last Post: 02-01-2008, 03:35 PM -
help with basic example
By fred in forum New To JavaReplies: 1Last Post: 07-20-2007, 05:45 PM


LinkBack URL
About LinkBacks

Bookmarks