SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jul 2006
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation special form check

    hello there!

    i need a form check which:

    displays error messages in a new window displayed in _self or _blank or etc... not in an alert box AND stops the cgi from sending data forward to my inbox (i'm not sure if it stops submit when just checked with javascript: if form.field.value='xyz')...

    could pls help on that

    Peter

  2. #2
    ✯✯✯ silver trophybronze trophy php_daemon's Avatar
    Join Date
    Mar 2006
    Posts
    5,284
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Here's something for you to play with:
    HTML Code:
    <script type="text/javascript">
    	function msg(text){
    	  popup=window.open('','Error','toolbar=0,status=0,menubar=0,fullscreen=no,width=200,height=200,resizable=0,scrollbars=1');
    	  popup.document.write(text);
    	}
    	
    	function check(frm){
    	  var validates=false;
    	  if(validates){
    	    return true;
    	  }else{
    	  	msg('Take a hike!');
    	  	return false;
    	  }
    	}
    </script>
    
    <form action="file.php" method="post" onsubmit="return check(this);">
        <input type="submit" value="Submit" />
    </form>
    Hope it helps.
    Saul


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
  •