Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Jan 2009
    Posts
    84
    Thanks
    5
    Thanked 0 Times in 0 Posts

    name field required?

    Hello,

    Herre is my shoutbox:

    http://drugspolicy.co.cc/445/shoutbox.inc.php

    Basicly, I want a popup box to say "You must have a name" if they try and send a message with no name.

    Thanks

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,928
    Thanks
    203
    Thanked 2,531 Times in 2,509 Posts
    Forbidden
    You don't have permission to access /445/shout.php on this server.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

  • #3
    New Coder
    Join Date
    Jan 2009
    Posts
    84
    Thanks
    5
    Thanked 0 Times in 0 Posts
    yer, ive done that purposefully, since i dont think its needed to make this work i just need an alert box to pop up if you click shout without anything in the email field.

  • #4
    New Coder
    Join Date
    Jan 2009
    Posts
    84
    Thanks
    5
    Thanked 0 Times in 0 Posts
    here is come code:

    Code:
    <body bgcolor="#3399FF">
    <table border="0" cellspacing="0" cellpadding="0">
    <form name="fShout" action="/445/shout.php" target="ShoutBox" method="post">
    <input type="hidden" name="sbID" value="">
    <input type="hidden" name="admin">
    <tr valign="top">
    <td>
      <table border="0" cellspacing="0" cellpadding="0" width="190"><tr>
      <td class="cssShoutText">Name:</td>
      <td align="right"><input type="text" name="sbName" maxlength="20" class="cssShoutForm" style="width:124px"></td>
    
      </tr><tr>
     <!-- <td class="cssShoutText">eMail:</td>-->
      <!--<td align="right"><input type="text" name="sbEMail" maxlength="75" class="cssShoutForm" style="width:124px"></td>
      </tr>--><tr>
      <td colspan="2">
        <table border="0" cellspacing="0" cellpadding="0" width="100%"><tr>
        <td class="cssShoutText">Message:</td>
        <td align="right"><input type="button" value="Smilies" class="cssShoutButton" onClick="newWindow('/445/smilies.php', 130, 300, 0, 0, 1)"></td>
        </tr></table>
    
      <textarea name="sbText" rows="3" style="width:190px; height:50px" wrap="virtual" class="cssShoutForm"></textarea>
        <table border="0" cellspacing="0" cellpadding="0" width="100%"><tr>
        <td><input type="button" name="Refresh" value="Refresh" class="cssShoutButton" onClick="this.disabled=true; refreshBox()"></td>
        <td align="center"><input type="button" name="Admin" value="Admin" class="cssShoutButton" onClick="this.disabled=true; login()"></td>
        <td align="right"><input type="button" name="Shout" value="Shout!" class="cssShoutButton" onClick="this.disabled=true; shoutIt()"></td>
        </tr></table>
      </td>
      </tr></table>
    
    </td>
          </tr><td height="10"></td><tr>
        <td>
        <iframe name="ShoutBox" src="/445/shout.php" class="cssShoutBox"
         width="190" height="300" frameborder="0"></iframe>
        </td>
    </tr>
    </form>
    </table>

  • #5
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,928
    Thanks
    203
    Thanked 2,531 Times in 2,509 Posts
    What do you mean by "not anything"? Will a space or a ? or "Mickey Mouse" suffice?

  • #6
    New Coder
    Join Date
    Jan 2009
    Posts
    84
    Thanks
    5
    Thanked 0 Times in 0 Posts
    I mean if they leave the field blank

  • #7
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    You'll be interested in adding an onsubmit to the form, I think.
    Are you a Help Vampire?


  •  

    Posting Permissions

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