Small bug with my chat room...................................................

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • |-|erc

    Small bug with my chat room...................................................

    Take a look at PHP chat with no login screen!
    Go straight to chat www.chatty.net very fast loading too.

    Try changing your alias from guest, and click the SEND button, it works.
    But change it and then press ENTER and the input frame dissapears .

    This is the main parts of the message and alias text boxes, they are in different
    forms, how can I stop it going blank when people hit enter??

    *************** *************** *************** *******

    <FORM NAME="MsgForm" ACTION="<?php echo($action); ?>" METHOD="POST" AUTOCOMPLETE="O FF" TARGET="<?php echo($target); ?>"
    onSubmit="retur n window.parent.v alidateSubmissi on();">

    <INPUT TYPE="text" NAME="M" SIZE="45" taborder=1 tabindex=1 MAXLENGTH="299" VALUE="<?php
    echo(htmlspecia lchars(stripsla shes($ValM))); ?>">

    <INPUT TYPE="hidden" NAME="sent" VALUE="0">
    <INPUT TYPE="submit" NAME="sendForm" VALUE="<?php echo(L_OK); ?>">

    </FORM>


    &nbsp;

    <form name="aliasform ">

    <INPUT TYPE="text" NAME="ZU" SIZE="5" MAXLENGTH="29" VALUE="<?php echo(htmlspecia lchars(stripsla shes(urlencode( $U)))); ?>">

    </form>

    *************** *************** *************** *******

    Can I detect if they hit Enter while in the alias text box, then set focus somewhere?
    Its like it submits a blank form and goes nowhere. is there a setting I can use on
    <form name="aliasform "> to stop that?

    Thanks
    Herc


    --
    \ oo
    \____|\mn
    / /_/ /\ \_\ - FREE THE TRUeMAN -
    / K-9/ \/_/ - Join www.chatty.net -
    /____/_____\ - Webmasters join www.BannerX.net -



  • Tim Van Wassenhove

    #2
    Re: Small bug with my chat room........... ............... ............... ..........

    In article <%vgsc.6980$L.3 027@news-server.bigpond. net.au>, |-|erc wrote:[color=blue]
    > Can I detect if they hit Enter while in the alias text box, then set focus somewhere?
    > Its like it submits a blank form and goes nowhere. is there a setting I can use on
    ><form name="aliasform "> to stop that?[/color]

    This is obviously a client-side question.
    I think you're better of asking this in a newsgroup on JavaScript.



    --
    Tim Van Wassenhove <http://home.mysth.be/~timvw/contact.php>

    Comment

    • |-|erc

      #3
      Re: Small bug with my chat room........... ............... ............... ..........

      "Tim Van Wassenhove" <euki@pi.be> wrote in[color=blue]
      > In article <%vgsc.6980$L.3 027@news-server.bigpond. net.au>, |-|erc wrote:[color=green]
      > > Can I detect if they hit Enter while in the alias text box, then set focus somewhere?
      > > Its like it submits a blank form and goes nowhere. is there a setting I can use on
      > ><form name="aliasform "> to stop that?[/color]
      >
      > This is obviously a client-side question.
      > I think you're better of asking this in a newsgroup on JavaScript.[/color]

      I know but its mingled with php, probably a html question, anyway I
      just copied the original <form...> statement into my 2nd form and changed
      the name.

      I think that calls validatesubmiss ion which handles both forms, and it can
      return true which I think stops the page reloading when it shouldn't.
      Good solution, now when you change the Alias and hit enter it works properly
      as if you hit Send, and changes your chat alias. Everyone here is welcome aboard
      that's the final major mod. www.chatty.net

      Herc



      Comment

      Working...