Re: javascript and submitting forms

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Unfortunately I havnt gotten it to work yet.  Am I missing something ?

PS the query works without the closewindow()

<?
include ('dbconn.php');
if(isset($submit))
	 {       
	$query = "INSERT INTO `comments` (  `track_id`, `cat_comments` ) VALUES
( '0', '$comm' );";
	mysql_query ($query, $link );		
	}      
?>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
</head>
<body>
<form action="comp_page3.php" method="POST">
Enter your details here:<br>
<textarea name="comm" rows="15" cols="30"></textarea><br>

<input type="submit" name="submit" value="Close and Save"
onClick="return window.close();"> 

</form>
</body>
</html>


On Mon, 2003-01-13 at 14:44, Micah Stevens wrote:
> The window.close(); function is not returning control to the form after
> closing the window. You must tell it to do so. Use:
> 
> onClick="return window.close();"
> 
> This will return the window.close() value to the submit button so that
> it can do its thing after the window has been closed.
> 
> Use the same thing for the other form items too. 
> 
> Hope this helps. 
> -Micah
> 
> 
> 
> On Mon, 2003-01-13 at 12:31, Mignon Hunter wrote:
> 
> > Hello List,
> > 
> > Has anyone had any problems using the onClick="window.close();"
> > function within a input type = "submit" ?
> > 
> > I'm trying 
> > 
> > <input type="submit" name="submit" value="submit"
> > onClick="window.close();"> 
> > 
> > But evidently it's reading the close before the submit because the value
> > of my form var is not being passed.  
> > 
> > I have also tried it in conjunction with a hidden field too.
> > 
> > <input type="hidden" value="<?echo $comm;?>"> 
> > <input type="submit" name="submit" value="submit"
> > onClick="window.close();"> 
> > 
> > If I dont use the onclick() the variable gets passed and/or entered into
> > db just fine.
> > 
> > Curious if anyone has had this problem or if anyone has any ideas...Thx
> > Mignon
> 
> -- 
> Raincross Technologies
> Development and Consulting Services
> http://www.raincross-tech.com
> 



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux