Results 1 to 2 of 2

Thread: Form Submitting only once

  1. #1
    Join Date
    Oct 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Form Submitting only once

    How can I make a form to only submit once in this code?

    <form name=form1 form method=post action=main.php?action=chat>
    <SELECT NAME="chatid">
    <OPTION VALUE="normal">Normal
    <OPTION VALUE="emote">Emote
    </SELECT>
    <input type=text name=msg size=55> <input class=button type=submit value=CHAT ondblclick=disabled=true>

    It's for chat so I can't change pages, and it only happens when they either hit enter twice or the page refreshes.

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,162
    Thanks
    263
    Thanked 690 Times in 678 Posts

    Default

    I'd use Javascript. This isn't a security issue, so it doesn't matter if they find a way to get around it, but just to stop them from submitting by accident.
    When you send it, set var disabled = 1; in Javascript; check this value with Javascript onSubmit to see if it works; when the data in the field is changed, just make disabled = 0;
    Daniel - Freelance Web Design | <?php?> | <html>| espaŮol | Deutsch | italiano | portuguÍs | catalŗ | un peu de franÁais | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •