Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Basic Form Issues

  • This topic is empty.
Viewing 15 posts - 1 through 15 (of 27 total)
  • Author
    Posts
  • #195529

    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.html

    It 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

    #195546
    JamesBarnsley
    Participant

    I 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?

    #195548

    Hi,

    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

    #195549
    JamesBarnsley
    Participant

    Do you have the HTML and JS code? Can you paste it?

    #195550
    #195552
    JamesBarnsley
    Participant

    Remove this …

    onclick=”pasuser(this.form)”

    And add this to the form tag …

    onsubmit=”pasuser(this)”

    Think that should work.

    #195554

    Nope, still does the same thing and breaks the login button.

    #195556
    JamesBarnsley
    Participant

    Try 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.

    #195557

    No such luck.

    #195562
    JamesBarnsley
    Participant

    What happens?

    #195563

    The 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.

    #195568
    JamesBarnsley
    Participant

    Can you add a closing </form> tag to your form.

    And try it again.

    #195572

    No change.

    This is what it looks like now:
    http://codepen.io/anon/pen/RNxQZL.html

    #195574
    JamesBarnsley
    Participant

    The onsubmit needs to be in the <form> tag before the name.

    <form onsubmit=”pasuser(this)” name=”login”>

    #195575

    This is what I’ve got now but it’s still the same. Button not working either.

    http://codepen.io/anon/pen/gbovXe.html

Viewing 15 posts - 1 through 15 (of 27 total)
  • The forum ‘Back End’ is closed to new topics and replies.