-1

hi all,
i had created a page in which users can be seen. and a edit button to edit. wen i click on the edit button a popup window will open and after edit is done and press submit button i wil get a msg that data editted. But the window is not closing. i need the window to close.
Thank u.

3
Contributors
15
Replies
17
Views
7 Years
Discussion Span
Last Post by rajarajan07
0

Sample:

<a href="javascript:top.close();"><img src="images/Exit.gif" style="position: absolute; right:5px; top:5px; left:310px" border="0"></img></a>
-1

Sample:

<a href="javascript:top.close();"><img src="images/Exit.gif" style="position: absolute; right:5px; top:5px; left:310px" border="0"></img></a>

my code is this

<td  align="left" style="width: 177px"><a href="Admin.php" onclick="window.open('http://localhost/Project/usercreation1.php','popup','width=400,height=250,scrollbars=no,resizable=no,toolbar=no,directories=no,location=center,menubar=no,status=no,left=370,center=0,top=300')">Add Users</a></td>

wen i click on addusers a window will open. Now wer should i put ur code.

0

hi niths where you have submit the data's at that button add window.close button()

like

<input type="submit" name="Submit" id="button" value="Submit" onclick="window.close()"/>

0

From the popup window have a button and use onclick="closefn"

within the closefn
use top.close();
or self.close();

0
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<title>Untitled</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="language" content="en" />
	<meta name="description" content="" />
	<meta name="keywords" content="" />
	<script language="javascript">
		function closefn(){
			self.close();
		}
	</script>
</head>
<body>
<input type="submit" name="Submit" id="button" value="Submit" onclick="closefn();"/> 
</body>
</html>
0

From the popup window have a button and use onclick="closefn"

within the closefn
use top.close();
or self.close();

can u say it again.i didnt understand, as i am new to php. i am posting my code here.

<html>
<body>
<script language="javascript" type="text/javascript">
		function check()
		{
			if(document.getElementById('txtusrid').value == "")
			{
				alert('Please enter Username');
				return false;
				
			}
			if(document.getElementById('txtpwd').value == "")
			{
				alert('Please enter password');
				return false;
			}
            if(document.getElementById('txtrep').value == "")
            {
                alert('Please enter reportingto');
                return false;
            }
		}
	</script>

<form action="insertuser.php" method="post">
<table align="center">
    
    <tr>
        <td style="color: navy;">Username</td>
        <td><input id="txtusrid" type="text" name="username"></td>
    </tr>
    <tr>
        <td style="color: navy;">Password</td>
        <td><input id="txtpwd" type="password" name="password"></td>
    </tr>
    <tr>
        <td style="color: navy;">Role</td>
        <td><select name="role">
        
        <option value="User" selected="selected">User</option>
        </select>
       </td>
    </tr>
    
    <!--<tr>
        <td style="color: navy;">Status:</td>
        <td><select name="status">
        
        <option value="Active" selected="selected">Active</option>
        </select>
       </td>
    </tr>-->
     
    <tr>
        <td></td>
        <td><input type="submit" name="btn" value="Submit" onclick="return check();"></td>
</table>
</form>
</body>
</html>
0

You asked how to close a window? what the above code relevant to?

code present in pop up window

0

Just add this line

<td><input type="submit" name="closebtn" value="Close" onclick="window.close();"></td>

after

<td><input type="submit" name="btn" value="Submit" onclick="return check();"></td>

I used close button, you can create a grahic like x as a small image and use the onclick="window.close();"

0

hey bee

do the following

in your insertuser.php

after php code add the following

<script language="javascript" type="text/javascript">
window.close();
</script>

0

Just add this line

<td><input type="submit" name="closebtn" value="Close" onclick="window.close();"></td>

after

<td><input type="submit" name="btn" value="Submit" onclick="return check();"></td>

I used close button, you can create a grahic like x as a small image and use the onclick="window.close();"

i think u didnt understand my query. i am sorry for my poor english

<td  align="left" style="width: 177px"><a href="Admin.php" onclick="window.open('http://localhost/Project/usercreation1.php','popup','width=400,height=250,scrollbars=no,resizable=no,toolbar=no,directories=no,location=center,menubar=no,status=no,left=370,center=0,top=300')">Add Users</a></td>

this is my pop up window. so wen i click on addusers i wil get a window with some fileds and after filling those fields i wil click on submit button and now that details will get added in to database. Now the popup window which i had done all these need to get closed automatically. so i think u understood my query.

0

i understood what you want, you do the above steps man

where you add the data's in to DB afterward s you have to add

<script>
window.close();
</script>

0

i understood what you want, you do the above steps man

where you add the data's in to DB afterward s you have to add

<script>
window.close();
</script>

ya thank u i got it.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.