1.11M Members

pop up window

 
0
 

so i have a form, when user click the button 1st javascript runs, than php runs. so if user hit submit button a window pop ups which is created in javascript.

problem is that i only want to pop up window if it goes in here

else{ //***********pop up window here*****************************}

otherwise dont create pop up window.

index.php

<?php
if(isset($_POST['button'])) 
{
    //check for error
    if(empty($_POST['color'])) 
    {
    }
    else
    {
        //no error
        //***********pop up window here*****************************
          echo"
          <div id='dialog01' title='Shipping Time'>
            random text
          </div>";
    }
}
?>
<form method='POST' action='index.php'>
<input type='file' name='color'>
<button type='submit' id='opener01' name='button'>submit</button>
</form>

jquery.js

    $.fx.speeds._default = 500;
    $( "#dialog01" ).dialog({
        autoOpen: false,   //don't auto open
        show: "blind",    //how to open window
        hide: "explode",  //how to exit window
        width: 400,
        resizable: false,
        modal: true,
        buttons: {
            Cancel: function() {
                $( this ).dialog( "close" );
             }
        }
    });

    $( "#opener01" ).click(function() {
          $( "#dialog01" ).dialog( "open" );
          return false;
    });

any idea's? i really want to do error testing in php and not in js.

Isn't it about time forums rewarded their contributors?

Earn rewards points for helping others. Gain kudos. Cash out. Get better answers yourself.

It's as simple as contributing editorial or replying to discussions labeled or OP Kudos

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article