user4433485
user4433485

Reputation:

JavaScript popup result from a form

This is the first time I am trying to make a popup working. I have done research over the internet but I could not see what I do wrong Perhaps you guys can see something wrong here. I will just link the form en the javascript for avoiding long script.

<script type="text/javascript"> 
$('.popup').popupWindow({ 
height:500, 
width:800, 
top:50, 
left:50 
}); 
</script>

And the form:

echo "<form action='getlist.php' method='post'> 
                    <input type='text' name='exte' class='exte' value=".$value['ext'].">  
                    <input type='submit' name='aanvragen' class='popup' id='aanvragen' value='aanvragen'></form>";
                    echo "</td>";

I want it to open getlist.php in a popup screen ;) Thanks

Edit: When I click on the button it just go to getlist.php in a full screen I want this to be in a popup

Upvotes: 0

Views: 1097

Answers (2)

Datsik
Datsik

Reputation: 14824

I don't see anything wrong with your code, your jQuery popupWindow is probably being called before the echo ever puts anything on the page so the listener never registers its self.

Upvotes: 2

David Ansermot
David Ansermot

Reputation: 6112

You have to create a link like this :

<a href="#" id="openPopup">Open form</a>

Then open in javascript something like this :

window.open ('popup.php', 'windowName', config='height=100, width=400, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, directories=no, status=no');

And you have your form in popup.php.

Upvotes: 1

Related Questions