- This topic is empty.
-
AuthorPosts
-
February 10, 2015 at 9:06 pm #195529Historical Forums UserParticipant
This is probably something quite simple for someone that knows what they’re doing but I haven’t created a website since Frontpage and now I’m using dreamweaver and guessing my way through things.
My website starts with a splash screen which asks for a password. I spent almost all day trying to get things to work by copy pasting code and I finally got it with this javascript:
http://codepen.io/anon/pen/mypBEM.htmlIt works great and does what it is supposed to when you click the button, however if you press enter it does not do the right thing, and puts whatever was entered in the password box into the URL at the end after a ?
I see this is used on a number of websites but I don’t have a clue how to use this function and I just want the form to submit when I press enter and not do whatever tricky PHP type thing it is doing.
Is there a simple fix to this?
Thanks,
Adam
February 11, 2015 at 3:51 am #195546JamesBarnsleyParticipantI doubt anyone will be able to answer this question based on what you have written here.
Is the Flash suppose to send the password to a PHP script?
Is the form purely in embedded flash?
February 11, 2015 at 4:02 am #195548Historical Forums UserParticipantHi,
Flash isn’t used at all. The form is basic html/javascript.
When submit is clicked, javascript sends the user to another page.
When enter is pressed, the text in the textbox goes into the address bar.
If there’s any more info I should provide, please tell me what you need to know and I’ll do my best.
Thanks
February 11, 2015 at 4:03 am #195549JamesBarnsleyParticipantDo you have the HTML and JS code? Can you paste it?
February 11, 2015 at 4:05 am #195550February 11, 2015 at 4:10 am #195552JamesBarnsleyParticipantRemove this …
onclick=”pasuser(this.form)”
And add this to the form tag …
onsubmit=”pasuser(this)”
Think that should work.
February 11, 2015 at 4:25 am #195554Historical Forums UserParticipantNope, still does the same thing and breaks the login button.
February 11, 2015 at 4:43 am #195556JamesBarnsleyParticipantTry this …
Remove this …
onclick=”pasuser(this.form)”
And add this to the form tag …
onsubmit=”pasuser(this)”
Delete the onkeyup=”” from the button.
Change the button type=”button” to type=”submit”
Think that should work.
February 11, 2015 at 4:47 am #195557Historical Forums UserParticipantNo such luck.
February 11, 2015 at 4:58 am #195562JamesBarnsleyParticipantWhat happens?
February 11, 2015 at 5:00 am #195563Historical Forums UserParticipantThe same. If I type in “adfs” and press enter the end of the URL becomes: index.html?id=adfs
The login button now does nothing.
February 11, 2015 at 5:04 am #195568JamesBarnsleyParticipantCan you add a closing </form> tag to your form.
And try it again.
February 11, 2015 at 5:09 am #195572Historical Forums UserParticipantNo change.
This is what it looks like now:
http://codepen.io/anon/pen/RNxQZL.htmlFebruary 11, 2015 at 5:11 am #195574JamesBarnsleyParticipantThe onsubmit needs to be in the <form> tag before the name.
<form onsubmit=”pasuser(this)” name=”login”>
February 11, 2015 at 5:17 am #195575Historical Forums UserParticipantThis is what I’ve got now but it’s still the same. Button not working either.
-
AuthorPosts
- The forum ‘Back End’ is closed to new topics and replies.