in magento i have created a custom button in admin area that opens new pop up window, in this window i have form very similar like this in this post Actually i want to do the same thing, like in that post, so here is my code:
class MyCompany_MyModule_Adminhtml_LabelController
extends Mage_Adminhtml_Controller_Action
{
public function setlabelAction()
{
if (!isset($_POST['submit']))
{
?>
<html>
<h2>Select label size:</h2>
<form action="LebelController.php" method="POST"><div>
<select name="SIZE">
<option value="1x1">1x1</option>
<option value="2x2">2x2</option>
<option value="3x3">3x3</option>
<option value="4x4">4x4</option>
</select>
<input type="submit" name="submit" value="Go">
</form>
</html>
<?php
}
else
{
echo ($_POST);
}
when i click on my custom button the new popup window with form inside appears, but the problem is that if i choose value from this combobox and click on this form button "Go", magento opens admin start page(grid page?) in this popup window. I wonder why is this happening? why it goes there, and just not relods my popup window where the choosed value is echoed?
?>
and<?php
. I never did this and I highly doubt it is as correct way. I think the old link post is referring to a template file i.e.phtml
but not.php
.