We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,275 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

pop up window

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.

2
Contributors
1
Reply
1 Day
Discussion Span
4 Months Ago
Last Updated
2
Views
hwoarang69
Posting Pro
569 posts since Feb 2012
Reputation Points: 6
Solved Threads: 0
Skill Endorsements: 7

@hwoarang69

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

Try to used JQUERY examples (just take the code apart and used whatever code you need and add it your own code) :

http://blog.theonlytutorials.com/a-very-simple-jquery-popup-ready-to-use-code/

http://www.queness.com/post/77/simple-jquery-modal-window-tutorial

LastMitch
Industrious Poster
4,165 posts since Mar 2012
Reputation Points: 132
Solved Threads: 335
Skill Endorsements: 45

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0752 seconds using 2.65MB