Yola Not Reading HTML Codes at all?

  • 1
  • Question
  • Updated 7 years ago
  • Answered
  • (Edited)
Is it just my mistake, or yola is totally not reading Javascript properly?
Hi, I've tried on adding a javascirpt login onto the lightbox code provided by nathan-but for some most STRANGE reason, the login is working all fine apart from when the proper username and password is entered, it simply loads, seems to think for a second, then come back for the login again. IF your wondering, NO i did not...

Mispell- it would have said "error"

provide a bad link- i double checked.

anyway heres the javascript code.

PLEASE HELP IF YOU CAN. I AM GETTING REALLY FRUSTRATED. maybe its just my mistake, not yola's. but if so please telll what it is so i can fix it!!!!
Photo of Mike

Mike

  • 192 Posts
  • 4 Reply Likes
  • Frustrated

Posted 7 years ago

  • 1
Photo of Andi North, Mangopear Media

Andi North, Mangopear Media

  • 782 Posts
  • 111 Reply Likes
Did you add the code with the <!--- at the start and the ---> at the end?

If you did, remove these and the code will work. These tags are used to stop code from actioning, it is used to post code on forums and the like.

Hope this helps,

Andi
Photo of Mike

Mike

  • 192 Posts
  • 4 Reply Likes
No, Actually at first I tried to post that as a code on my forum post with the or //fferewbla bla bla// WHATSOEVER.
Photo of Nazlie

Nazlie

  • 1721 Posts
  • 51 Reply Likes
Hi Mike

I do understand your frustration with the code not working. We would like to help, but need to give you some feedback and ask for more details. I hope that we will be able to work together to help you find a solution to this problem.

Firstly, it looks like there are a few things not right with that code. As Andi mentioned, the <!-- and --> tags mean that the script is commented out. This means that it will not work if you pasted it as is into the HTML Widget. Also, there's another <!-- and --> before and after Begin and End, which will mean that the code will not read, for the same reason - it is commented out.

Secondly, the <BODY> tag looks out of place. It looks like it does not need to be included in the code.

Would you mind sharing your URL (website address) so that we can take a look? Also, where did you find this script? Maybe seeing the source of the script will help us solve why it is not working for you.

Nazlie
Photo of Mike

Mike

  • 192 Posts
  • 4 Reply Likes
Thank you for answering.

First of, as I mentioned all of the tags are not included in the real code.
Secondly, the body tag (my mistake is now removed)

Script Source=
http://javascript.internet.com/passwo...

My current site with the javascript login:
ChatHangout.yolasite.com

Thanks
Photo of Mike

Mike

  • 192 Posts
  • 4 Reply Likes
Yep, still not working. :(
Photo of Nazlie

Nazlie

  • 1721 Posts
  • 51 Reply Likes
Hi Mike

Thank you for posting the URL of your site. I have checked and it appears to be working.


Is that correct?

Nazlie
Photo of Mike

Mike

  • 192 Posts
  • 4 Reply Likes
Hmm, I think you have internet explorer- for usually it appears messed up on IE.

How big is your computer? Maybe it's just the size, but maybe it's browser- Firefox and Explorer sure are different. Which do you use. For what I mean is this is what it looks like on mine-



But anyway check the functions- the username and password is:
USERNAME:
member1
PASSWORD:
Password1

(I'm gonna have to encrypt that info on the site soon, if you know what I mean)

Tell me if it takes you to

1.That page again

2.Some other page with a chatbox

3.Some other website called "miniclip.com"

4.None of the above

Thanks
Photo of Nazlie

Nazlie

  • 1721 Posts
  • 51 Reply Likes
Apologies for the late response here. I was offline for a few hours.

I viewed your site in Firefox with a high screen resolution, which is why it looks slightly different on my screen.

Also, I don't see the link to your site and can't check the login function for you. Did you remove that post from this thread?
Photo of Francois

Francois, Employee

  • 282 Posts
  • 19 Reply Likes
Hi Mike,

I've looked at your code and compared it with the code found on http://javascript.internet.com/passwords/multiple-users-source.html, which is the link you provided as the source of the code. I can't seem to find the bit that you're supposed to copy to the head of your page, in the head of your page. At this stage it would seem that the project is incomplete, which may be one of the reasons why your multi user login system is not yet functional. Also, the reason why you may be experiencing difficulty with this specific script is because you have a free Yola account and are unable to edit the head tags of your site.

What you could try, is to drop the code into two HTML widgets onto your page. In the first widget, drop this code:

<!--

<SCRIPT LANGUAGE="JavaScript">

function Login(){
var done=0;
var username=document.login.username.value;
username=username.toLowerCase();
var password=document.login.password.value;
password=password.toLowerCase();
if (username=="member1" && password=="password1") { window.location="page1.html"; done=1; }
if (username=="member2" && password=="password2") { window.location="page2.html"; done=1; }
if (username=="member3" && password=="password3") { window.location="page3.html"; done=1; }
if (done==0) { alert("Invalid login!"); }
}
</SCRIPT>

-->

In the second HTML widget, drop this code:

<!--

<center>
<form name=login>
<table width=225 border=1 cellpadding=3>
<tr><td colspan=2><center><font size="+2"><b>Members-Only Area!</b></font></center></td></tr>
<tr><td>Username:</td><td><input type=text name=username></td></tr>
<tr><td>Password:</td><td><input type=text name=password></td></tr>
<tr><td colspan=2 align=center><input type=button value="Login!" onClick="Login()"></td></tr>
</table>
</form>
</center>

-->

Please let me know if this helps.
Photo of Mike

Mike

  • 192 Posts
  • 4 Reply Likes
No, call me stupid, but I still can't get it to work. :(
Photo of Justine

Justine

  • 751 Posts
  • 45 Reply Likes
Hi Mike,
Can you let us know which part of the code isn't working, and whether you're having problems with the HTML Widgets?
Photo of Mike

Mike

  • 192 Posts
  • 4 Reply Likes
I think the HTML widget is working fine, its just that the code itself I must have added a tag somewhere else or something in the wrong place. It's probably not working because of my mistake, but I can't seem to find it.

By the way the login isnt working. the username and password is:
member1
password1

And when entered instead of taking to the member page, it just reloads the page. Any help?
Photo of Sanja

Sanja, Official Rep

  • 10698 Posts
  • 495 Reply Likes
Hello Mike, I attempted to try and find your site but it appears that http://chathangout.yolasite.com/ is no longer published. Can you please share with me your URL or if you have not published it, send me an email to support@yola.com, ATTN: Sanja and I will follow up with you there. I'm sure there must be a code that is causing this.
Photo of Mike

Mike

  • 192 Posts
  • 4 Reply Likes
Sorry about that, the new domain is 5achathangout.yolasite.com
Photo of Francois

Francois, Employee

  • 282 Posts
  • 19 Reply Likes
Hi Mike,

I have followed the procedure as I laid it out above and I can confirm that the login box on your page now works. I looked at the code you had in the HTML widget and I think that reason for it not working, was due to all the code, including a few <!-- <head> and <body> --> tags, being dropped in a single HTML widget and not 2 seperate ones, as specified above, thereby quite possibly causing a conflict between the scripts.

I made a backup of your code though. It is on a page I created within your website (tempcode.php).

I hope this helps.
Photo of Mike

Mike

  • 192 Posts
  • 4 Reply Likes
Everything works fine. it turns out somehow the button was causing eveyrthing. no clue why. i used your code- worked fine. then i put in my button- started working badly again. put in default- worked fine again.