Solved

Form not submitting when using Jquery Magnific Popup plugin

Posted on 2014-02-26
17
3,420 Views
Last Modified: 2014-04-01
I am using Magnific popup Jquery plugin to popup a form. That is all working. The form comes up and looks correct. When i fill it out and click on Submit its not running the Post PHP code to add the information to the database. I am loading this page using Ajax. code is below.

Magnific Code to load the page, this is no the full code of this page.

<li><a rel="nofollow" href="window_add_asset.php" class="open-popup-add-asset">Add Asset</a></li>
<script type="text/javascript">
$('.open-popup-add-asset').magnificPopup({
  type:'ajax',
  closeOnBgClick: false,
});
</script>

Open in new window


window_add_asset.php code

<?php
 function assetname_check($assetname){
 
$db = new PDO("mysql:host=localhost;dbname=ats", "root", "pass");
 
 
$stmt = $db->prepare("SELECT asset FROM atsassets WHERE asset = :asset_name");
$stmt->bindParam('asset_name', $assetname);
$stmt->execute();

$result = $stmt->fetch();

$db = null;

 if (!empty($result)){
  return "<center><b>Asset already exsists in Database</b></center>";
 }else{
  return 1;
 }
 
}

 function serial_check($serial){
 
 $db = new PDO("mysql:host=localhost;dbname=ats", "root", "pass");
 
$stmt = $db->prepare("SELECT serial FROM atsassets WHERE serial = :serial_number");
$stmt->bindParam('serial_number', $serial);
$stmt->execute();

$result = $stmt->fetch();

$db = null;

 if (!empty($result)){
  return "<center><b>Serial already exsists in Database</b></center>";
 }else{
  return 1;
 }
 
}


?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<link href="css/templatemo_style.css" rel="stylesheet" type="text/css" />

<script type="text/javascript" src="js/jquery.js"></script>

<link rel="stylesheet" href="css/validationEngine.jquery.css" type="text/css"/>


<script src="js/validate/languages/jquery.validationEngine-en.js" type="text/javascript" charset="utf-8"></script>
<script src="js/validate/jquery.validationEngine.js" type="text/javascript" charset="utf-8"></script>

<script>
jQuery(document).ready(function(){
	// binds form submission and fields to the validation engine
	jQuery("#request").validationEngine('attach');

	$("#request").bind("jqv.form.validating", function(event){
		$("#hookError").html("")
	})

	$("#request").bind("jqv.form.result", function(event , errorFound){
		if(errorFound) $("#hookError").append("There is some problems with your form");
	})

});
</script>

<?php
include ("authenticate.php");
authenticate();
require ('js/pdo_connection.php');
require ('config.php');
?>

<div class="white-popup-add-asset">

<br><br><br>
<form name="window_add_asset.php" method="post" id="request">

			<b>Asset Information</b>
			<table width="700">
				<tr>
					<td><b>Asset Tag:</b></td>
					<td><input class="validate[required] searchfield" type="text" name="asset" value=""></td>
					<td><b>Serial Tag:</b></td>
					<td><input class="validate[required] searchfield" type="text" name="serial" value=""></td>
				</tr>
				<tr>
					<td><b>Model:</b></td><td>
					<?php
					
					pdo_connection($open_inventory_connection,$open_inventory_database);

$query = "SELECT names FROM model ORDER BY names ASC";

$result = $db->query($query);
$error = $db->errorInfo();
if (!is_null($error[2])) {
    echo "Query failed! " . $error[2];
}
?>
<select name="model" class="validate[required] searchfield">
<option value= "" selected value=""></option>
<?php
while($data = $result->fetch(PDO::FETCH_ASSOC)) {

  $model = htmlentities($data['names']);
  echo '<option value="'.$model.'">'.$model."</option>\n";
}
$result->closeCursor();
$db = null;
?>
</select>
                    
                    </td>
					<td><b>Operating System:</b></td><td>
					
                <?php
 					pdo_connection($open_inventory_connection,$open_inventory_database);

$query = "SELECT names FROM os ORDER BY names ASC";

$result = $db->query($query);
$error = $db->errorInfo();
if (!is_null($error[2])) {
    echo "Query failed! " . $error[2];
}

?>
<select name="os" class="validate[required] searchfield">
<option value= "" selected value=""></option>
<?php
while($data = $result->fetch(PDO::FETCH_ASSOC)) {

  $os = htmlentities($data['names']);
  echo '<option value="'.$os.'">'.$os."</option>\n";
}
$result->closeCursor();
$db = null;
?>
</select>           
                </td>  
				</tr>
				<tr>
					<td><b>Date Setup:</b></td>
                   <?php $date = date("Y-m-d");
				   ?>
                    <td><input class="searchfield" type="text" name="datesetup" value="<?php echo $date ?>"></td>
										<td><b>Asigned Too:</b></td>
					<td>inv</td>
				</tr>
			</table>

            <br />
			            <br />
            <input class="button" type="submit" name="form" value="Add Asset">
            </form>
            			<?php

if($_SERVER['REQUEST_METHOD'] == "POST") {

pdo_connection($open_inventory_connection,$open_inventory_database);
 
  	$assetname_exists = assetname_check($_POST['asset']);
	$serial_exists = serial_check($_POST['serial']);

if ($assetname_exists != 1){
 echo "$assetname_exists";
 break; } 
 else if ($serial_exists != 1){
 echo "$serial_exists";
 break; } else
  $type = "Add Computer";
  $changedate = date("Y-m-d H:i:s");
  $model = $_POST['model'];
  $os = $_POST['os'];
  $asset = trim(strtoupper($_POST['asset']));
  $serial = trim(strtoupper($_POST['serial']));
  $setupdate = $changedate;
$asignedto = "inv";
$status = "Restore";

	$sql = "INSERT INTO atsassets 
(asset, serial, model, os, lastupdate, datesetup, setupdate, asignedto, status) 
VALUES 
(:asset, :serial, :model, :os, :lastupdate, :datesetup, :setupdate, :asignedto, :status)";
try
{
$qeury = $db->prepare($sql);
$qeury->execute(array(
':asset'=>$asset,
':serial'=>$serial,
':model'=>$model,
':os'=>$os,
':lastupdate'=>$date,
':datesetup'=>$date,
':setupdate'=>$date,
':asignedto'=>$asignedto,
':status'=>$status

));
}
catch(PDOException $e)
{
echo 'Query failed'.$e->getMessage();
} 
  
$byuser = $_SERVER['REMOTE_USER'];
  
  	$sql = "INSERT INTO logs 
(type, asset, serial, model, os, datesetup, changedate, asignedto, byuser, setupdate) 
VALUES 
(:type, :asset, :serial, :model, :os, :datesetup, :changedate, :asignedto, :byuser, :setupdate)";

try
{
$qeury = $db->prepare($sql);
$qeury->execute(array(
':type'=>$type,
':asset'=>$asset,
':serial'=>$serial,
':model'=>$model,
':os'=>$os,
':datesetup'=>$date,
':changedate'=>$changedate,
':asignedto'=>$asignedto,
':byuser'=>$byuser,
':setupdate'=>$setupdate
));
}
catch(PDOException $e)
{
echo 'Query failed'.$e->getMessage();
} 
  
echo "<br /><center><b>Record has been added</b><center>";
$db = null;	
}
?>

</div>

Open in new window

0
Comment
Question by:ats2012
  • 10
  • 7
17 Comments
 
LVL 82

Expert Comment

by:leakim971
Comment Utility
please provide a link to see your page OR do a right click on your page and post the content
0
 

Author Comment

by:ats2012
Comment Utility
I won't be able to provide link to my since. This is an internal website. Here is the full code of the main page and the page that gets called using AJAX:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ATS Management</title>
<link rel="shortcut icon" href="images/ats_logo_new.ico">

<link href="css/templatemo_style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="css/ddsmoothmenu.css" />
<link rel="stylesheet" type="text/css" href="css/magnific-popup.css" />

<script type="text/javascript" src="js/jquery1.9.js"></script>

<script type="text/javascript" src="js/jquery.magnific-popup-inline.js"></script>		
<script type="text/javascript" src="js/ddsmoothmenu.js"></script>

<script language="javascript" type="text/javascript">
function clearText(field)
{
    if (field.defaultValue == field.value) field.value = '';
    else if (field.value == '') field.value = field.defaultValue;
}
</script>

<script type="text/javascript">

ddsmoothmenu.init({
	mainmenuid: "templatemo_menu", //menu DIV id
	orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
	classname: 'ddsmoothmenu', //class added to menu's outer DIV
	//customtheme: ["#1c5a80", "#18374a"],
	contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
})
</script> 

<?php
include ("authenticate.php");
authenticate();
include ("site_navigation.php");
require ('js/pdo_connection.php');
require ('config.php');
?>
</head>

<body>

<div id="templatemo_header_wrapper">
    <div id="templatemo_header">
        <div id="site_title"><a href="index.php"><img id="logo" src="images/ats_logo_new.png"/></a>
			
		
		</div>
		<div id="search">
		<form action="results.php" method="get" id="search_form">
	<input class="searchfield" type="text" name="search" value="Search..." onfocus="if (this.value == 'Search...') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search...';}" />
	<input class="searchbutton" type="submit" value="Go"/>

</form>
		</div>
        <div id="templatemo_menu" class="ddsmoothmenu">
            <ul>
                <li><a href="index.php" class="selected">Assets</a>
                    <ul>
                        <li><span class="top"></span><span class="bottom"></span></li>
                        <li><a rel="nofollow" href="window_add_asset.php" class="open-popup-add-asset">Add Asset</a></li>
<script type="text/javascript">
$('.open-popup-add-asset').magnificPopup({
  type:'ajax',
  closeOnBgClick: false,
  overflowY: 'scroll'
});
</script>
						<li><a href="window_cisco.php" class="open-popup-cisco">Cisco Equipment</a></li>
<script type="text/javascript">
$('.open-popup-cisco').magnificPopup({
  type:'ajax',
  closeOnBgClick: false,
  overflowY: 'scroll'
});
</script>
                  	</ul>
                </li>
                <li><a href="users.php">Users</a>
                    <ul>
                        <li><span class="top"></span><span class="bottom"></span></li>
                        <li><a rel="nofollow" href="add_user.php">Add User</a></li>
                        <li><a href="window_user_waiting.php" class="open-popup-user-waiting">Approve New Users</a></li>
<script type="text/javascript">
$('.open-popup-user-waiting').magnificPopup({
  type:'ajax',
  closeOnBgClick: false,
  overflowY: 'scroll'
});
</script>
                  	</ul>
                </li>
				<li><a href="">Monitors</a>
                    <ul>
                        <li><span class="top"></span><span class="bottom"></span></li>
                        <li><a rel="nofollow" href="http://www.templatemo.com/page/1">Add Monitor</a></li>
                        <li><a rel="nofollow" href="http://www.templatemo.com/page/2">Edit Monitors</a></li>
						<li><a rel="nofollow" href="http://www.templatemo.com/page/2">Available Monitors</a></li>
                  	</ul>
                </li>
				<li><a href="">Other</a>
                    <ul>
                        <li><span class="top"></span><span class="bottom"></span></li>
                        <li><a rel="nofollow" href="http://www.templatemo.com/page/2">Checkout Equipment</a></li>
						<li><a rel="nofollow" href="http://www.templatemo.com/page/2">Reports</a></li>
						<li><a rel="nofollow" href="http://www.templatemo.com/page/2">Logs</a></li>
						<li><a rel="nofollow" href="http://www.templatemo.com/page/2">Add Department</a></li>
						<li><a rel="nofollow" href="http://www.templatemo.com/page/2">Add Models</a></li>
						<li><a rel="nofollow" href="http://www.templatemo.com/page/2">Add OS</a></li>
						<li><a rel="nofollow" href="http://www.templatemo.com/page/2">Printers</a></li>
						<li><a rel="nofollow" href="http://www.templatemo.com/page/2">Replacements</a></li>
                  	</ul>
                </li>
            </ul>
            <br style="clear: left" />
        </div> <!-- end of templatemo_menu -->
    </div> <!-- END of header -->
</div>

<div id="templatemo_main_top"></div>
<div id="templatemo_main">

<?php

pdo_connection($open_inventory_connection,$open_inventory_database);

$query_prod = "SELECT count(*) FROM atsassets WHERE asignedto = 'inv' and status like '%Production%' order by model";
$result_prod = $db->query($query_prod);
$error = $db->errorInfo();
if (!is_null($error[2])) {
    echo "Query failed! " . $error[2];
	}
$numofrows_prod = $result_prod->fetch(PDO::FETCH_NUM);
$result_prod->closeCursor();

$query_restore = "SELECT count(*) FROM atsassets WHERE asignedto = 'inv' and status = 'Restore' order by model";
$result_restore = $db->query($query_restore);
$error = $db->errorInfo();
if (!is_null($error[2])) {
    echo "Query failed! " . $error[2];
	}
$numofrows_restore = $result_restore->fetch(PDO::FETCH_NUM);
$result_restore->closeCursor();

$query_develop = "select count(*) from `atsassets` where asignedto = 'inv' and status = 'Development' order by model";
$result_develop = $db->query($query_develop);
$error = $db->errorInfo();
if (!is_null($error[2])) {
    echo "Query failed! " . $error[2];
	}
$numofrows_develop = $result_develop->fetch(PDO::FETCH_NUM);
$result_develop->closeCursor();

$query_monitors = "SELECT count(*) FROM monitors WHERE asignedto = 'inv' order by size";
$result_monitors = $db->query($query_monitors);
$error = $db->errorInfo();
if (!is_null($error[2])) {
    echo "Query failed! " . $error[2];
	}
$numofrows_monitors = $result_monitors->fetch(PDO::FETCH_NUM);
$result_monitors->closeCursor();

$query_unasigned = "select count(*) FROM atsassets WHERE asignedto = 'notassigned' and status like '%Production%' and checkout = 'no'";

$result_unasigned = $db->query($query_unasigned);
$error = $db->errorInfo();
if (!is_null($error[2])) {
    echo "Query failed! " . $error[2];
	}
$numofrows_unasigned = $result_unasigned->fetch(PDO::FETCH_NUM);
$result_unasigned->closeCursor();

$query_windowsxp = "select count(os) from atsassets where os = 'Windows XP'";
$result_windowsxp = $db->query($query_windowsxp);
$error = $db->errorInfo();
if (!is_null($error[2])) {
    echo "Query failed! " . $error[2];
	}
$numofrows_windowsxp = $result_windowsxp->fetch(PDO::FETCH_NUM);
$result_windowsxp->closeCursor();

$query_windows7 = "select count(os) from atsassets where os = 'Windows 7'";
$result_windows7 = $db->query($query_windows7);
$error = $db->errorInfo();
if (!is_null($error[2])) {
    echo "Query failed! " . $error[2];
	}
$numofrows_windows7 = $result_windows7->fetch(PDO::FETCH_NUM);
$result_windows7->closeCursor();

$query_windows_server_2003 = "select count(os) from atsassets where os = 'Windows Server 2003'";
$result_windows_server_2003 = $db->query($query_windows_server_2003);
$error = $db->errorInfo();
if (!is_null($error[2])) {
    echo "Query failed! " . $error[2];
	}
$numofrows_windows_server_2003 = $result_windows_server_2003->fetch(PDO::FETCH_NUM);
$result_windows_server_2003->closeCursor();

$query_windows_server_2008 = "select count(os) from atsassets where os = 'Windows Server 2008'";
$result_windows_server_2008 = $db->query($query_windows_server_2008);
$error = $db->errorInfo();
if (!is_null($error[2])) {
    echo "Query failed! " . $error[2];
	}
$numofrows_windows_server_2008 = $result_windows_server_2008->fetch(PDO::FETCH_NUM);
$result_windows_server_2008->closeCursor();

$query_windows_server_2012 = "select count(os) from atsassets where os = 'Windows Server 2012'";
$result_windows_server_2012 = $db->query($query_windows_server_2012);
$error = $db->errorInfo();
if (!is_null($error[2])) {
    echo "Query failed! " . $error[2];
	}
$numofrows_windows_server_2012 = $result_windows_server_2012->fetch(PDO::FETCH_NUM);
$result_windows_server_2012->closeCursor();

$db = null;


$con = mysql_connect($open_inventory_connection,$open_inventory_username,$open_inventory_password);
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
 
mysql_select_db($open_inventory_database);

$format = 'Y-m-j';
$line_date = date ( $format );
$line_user = date ( $format );


?>
	    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript">
      google.load("visualization", "1", {packages:["corechart"]});
      google.setOnLoadCallback(drawChart);
	  google.setOnLoadCallback(drawChart_os);
	  google.setOnLoadCallback(drawChart_line);
	  
	        function drawChart_line() {
        var data = google.visualization.arrayToDataTable([
          ['Day', 'Assets'],
		  <?php
		  $day = 0;
		  while ($day <= 30 ) {
			$date_two = date ( $format, strtotime ( "-$day day" . $line_date ) );
			pdo_connection($open_inventory_connection,$open_inventory_database);
			
			$query = "select count(*) from deploylog where date(deploydate) = " .$db->quote($date_two);
			$result = $db->query($query);
			$error = $db->errorInfo();
			if (!is_null($error[2])) {
			echo "Query failed! " . $error[2];
			}
			$numofrows = $result->fetch(PDO::FETCH_NUM);
			$result->closeCursor();
			
			
		  ?>
		  
          ['<?php echo $date_two ?>',  <?php echo $numofrows[0] ?>],

		  <?php
		  $day++;
}
$db = null;
?>
        ]);

        var options = {
		backgroundColor: '#D6D6CE',
          title: 'Deployed Assets - Last 30 days'
        };

        var chart = new google.visualization.LineChart(document.getElementById('chart_div_line'));
        chart.draw(data, options);
      }
	  	  
	  
      function drawChart() {
        var data = google.visualization.arrayToDataTable([
          ['Task', 'Hours per Day'],
          ['Assets Ready for Deployment',     <?php echo $numofrows_prod[0] ?>],
          ['Assets Needing to be Restored',      <?php echo $numofrows_restore[0] ?>],
          ['Development Machines',  <?php echo $numofrows_develop[0] ?>],
          ['Available Monitors', <?php echo $numofrows_monitors[0] ?>],
          ['Unasigned Assets',    <?php echo $numofrows_unasigned[0] ?>]
        ]);

        var options = {
		backgroundColor: '#D6D6CE',
          title: 'Asset Overview',
		  is3D: true
        };

        var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
        chart.draw(data, options);
      }
	  
	  	        function drawChart_os() {
        var data_bar = google.visualization.arrayToDataTable([
          ['Operating Systems', 'Windows XP', 'Windows 7','Windows Server 2003','Windows Server 2008','Windows Server 2012'],
          ['Total',  <?php echo $numofrows_windowsxp[0] ?>,<?php echo $numofrows_windows7[0] ?>,<?php echo $numofrows_windows_server_2003[0] ?>,<?php echo $numofrows_windows_server_2008[0] ?>,<?php echo $numofrows_windows_server_2012[0] ?>]
        ]);

        var options_bar = {
		backgroundColor: '#D6D6CE',
          title: 'Operating Systems',
        };

        var chart = new google.visualization.ColumnChart(document.getElementById('chart_div_two'));
        chart.draw(data_bar, options_bar);
      }

    </script>
 <table border="0">
  <tr>
  <td>
    <div id="chart_div" style="width: 450px; height: 200px;"></div>
	</td>
	<td>
	<div id="chart_div_two" style="width: 450px; height: 200px;"></div>
	</td>
</tr>
  <tr>
  <td colspan="2">
    <div id="chart_div_line" style="width: 900px; height: 270px;"></div>
	</td>
	<td>
	</td>
</tr>
</table>

<br>
    <div class="fp_box5">
		<a href="window_assets_ready.php" class="open-popup-ready">
        <img id="logo" src="images/navigation/computer_deploy.png" width='45' height='45'/>
        <h2>Assets Ready for Deployment</a></h2>
        <center><h5><?php echo $numofrows_prod[0] ?></h5></center>
    </div>
	<script type="text/javascript">
$('.open-popup-ready').magnificPopup({
  type:'ajax',
  closeOnBgClick: false,
  overflowY: 'scroll'
});
</script> 
    <div class="fp_box5">
		<a href="window_assets_restore.php" class="open-popup-restore">
        <img id="logo" src="images/navigation/computer_restore.png" width='45' height='45'/>
        <h2>Assets Needing to be Restored</a></h2>
        <center><h5><?php echo $numofrows_restore[0] ?></h5></center>
    </div>
<script type="text/javascript">
$('.open-popup-restore').magnificPopup({
  type:'ajax',
  closeOnBgClick: false,
  overflowY: 'scroll'
});
</script>
    <div class="fp_box5">
		<a href="window_monitors.php" class="open-popup-monitor">
        <img id="logo" src="images/navigation/monitor2.png" width='45' height='45'/>
        <h2>Monitors Available</a></h2><br>
        <center><h5><?php echo $numofrows_monitors[0] ?></h5></center>
    </div>
	<script type="text/javascript">
$('.open-popup-monitor').magnificPopup({
  type:'ajax',
  closeOnBgClick: false,
  overflowY: 'scroll'
});
</script>
    <div class="fp_box5">
		<a href="window_assets_unassigned.php" class="open-popup-unassigned">
        <img id="logo" src="images/navigation/computer_unasigned.png" width='45' height='45'/>
        <h2>Unassigned Assets</a></h2><br>
        <center><h5><?php echo $numofrows_unasigned[0] ?></h5></center>
    </div>
<script type="text/javascript">
$('.open-popup-unassigned').magnificPopup({
  type:'ajax',
  closeOnBgClick: false,
  overflowY: 'scroll'
});
</script>
	<div class="fp_box5">
		<a href="window_assets_develop.php" class="open-popup-develop">
        <img id="logo" src="images/navigation/computer_development.png" width='45' height='45'/>
        <h2>Development Machines</a></h2>
		<br>
        <center><h5><?php echo $numofrows_develop[0] ?></h5></center>
    </div>
<script type="text/javascript">
$('.open-popup-develop').magnificPopup({
  type:'ajax',
  closeOnBgClick: false,
  overflowY: 'scroll'
});
</script>

    <div class="cleaner h0"></div>
	<!--
    <div class="col_12 float_l">
    	<h2>Welcome To Work Center</h2>
        
        <p><em>Nunc dictum cursus laoreet. Cras dapibus quam sed dolor rhoncus tincidunt.</em></p>
        <p><a href="http://www.templatemo.com" rel="nofollow" target="_parent">Work Center</a> is  free css template provided by <a href="http://www.templatemo.com" rel="nofollow">templatemo.com</a> for your personal or commercial websites. Cras vulputate laoreet porta. In mi enim, pulvinar vitae vehicula vestibulum, fringilla quis risus. Fusce vel mi mi, ac mollis nisi. Mauris mollis fringilla molestie. Nunc a libero elit, at dignissim elit. </p>
    </div>
    <div class="col_12 float_r">
    	<h2>Web Technologies</h2>
        
        <p><em>Sed imperdiet fermentum sagittis. Donec ut diam sed enim dapibus id non metus.</em></p>
        <p>Donec est dolor, pharetra ac consectetur vel, pretium nec dui. Duis dignissim viverra nisi vitae molestie. Proin pulvinar accumsan leo, id rutrum dui consequat quis. Sed at risus quis eros venenatis semper. Quisque neque tellus, dignissim sed ac nunc. Phasellus vitae tellus metus nulla. Validate <a href="http://validator.w3.org/check?uri=referer" rel="nofollow"><strong>XHTML</strong></a> &amp; <a href="http://jigsaw.w3.org/css-validator/check/referer" rel="nofollow"><strong>CSS</strong></a>.</p>	

	</div>
	
    
    <div class="cleaner"></div> -->
</div> <!-- END of main -->





<div id="templatemo_footer_wrapper">
	<div id="templatemo_footer">
	
		<div class="col col_14">
        	<h5>Assets</h5>
            <ul class="footer_list">
                <li><a rel="nofollow" href="window_add_asset.php" class="open-popup-add-asset">Add Asset</a></li>
<script type="text/javascript">
$('.open-popup-add-asset').magnificPopup({
  type:'ajax',
  closeOnBgClick: false,
  overflowY: 'scroll'
});
</script>				
            	<li><a href="window_cisco.php" class="open-popup-cisco">Cisco Equipment</a></li>
<script type="text/javascript">
$('.open-popup-cisco').magnificPopup({
  type:'ajax',
  closeOnBgClick: false,
  overflowY: 'scroll'
});
</script>
			</ul>   
        </div>
        <div class="col col_14">
        	<h5>Users</h5>
            <ul class="footer_list">
            	<li><a href="add_user.php">Add User</a></li>
                <li><a href="window_user_waiting.php" class="open-popup-user-waiting">Approve New Users</a></li>
			</ul>
        </div>
<script type="text/javascript">
$('.open-popup-user-waiting').magnificPopup({
  type:'ajax',
  closeOnBgClick: false,
  overflowY: 'scroll'
});
</script> 
        <div class="col col_14">
        	<h5>Monitors</h5>	
            <ul class="footer_list">
                <li><a href="#" class="social facebook">Add Monitor</a></li>
                <li><a href="#" class="social twitter">Edit Monitors</a></li>
			</ul>
        </div>
		
        <div class="col col_14 no_margin_right">
        	<h5>Other</h5>	
            <ul class="footer_list">
                <li><a href="#" class="social feed">Checkout Equipment</a></li>
				<li><a href="#" class="social feed">Reports</a></li>
				<li><a href="#" class="social feed">Logs</a></li>
				<li><a href="#" class="social feed">Printers</a></li>
				<li><a href="#" class="social feed">Replacements</a></li>
			</ul>
        </div>
        
    <div class="cleaner"></div>
    </div>
</div> <!-- END of footer -->

</body>
</html>

Open in new window




<?php
 function assetname_check($assetname){
 
$db = new PDO("mysql:host=localhost;dbname=ats", "root", "pass");
 
 
$stmt = $db->prepare("SELECT asset FROM atsassets WHERE asset = :asset_name");
$stmt->bindParam('asset_name', $assetname);
$stmt->execute();

$result = $stmt->fetch();

$db = null;

 if (!empty($result)){
  return "<center><b>Asset already exsists in Database</b></center>";
 }else{
  return 1;
 }
 
}

 function serial_check($serial){
 
 $db = new PDO("mysql:host=localhost;dbname=ats", "root", "pass");
 
$stmt = $db->prepare("SELECT serial FROM atsassets WHERE serial = :serial_number");
$stmt->bindParam('serial_number', $serial);
$stmt->execute();

$result = $stmt->fetch();

$db = null;

 if (!empty($result)){
  return "<center><b>Serial already exsists in Database</b></center>";
 }else{
  return 1;
 }
 
}


?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<link href="css/templatemo_style.css" rel="stylesheet" type="text/css" />

<script type="text/javascript" src="js/jquery.js"></script>

<link rel="stylesheet" href="css/validationEngine.jquery.css" type="text/css"/>


<script src="js/validate/languages/jquery.validationEngine-en.js" type="text/javascript" charset="utf-8"></script>
<script src="js/validate/jquery.validationEngine.js" type="text/javascript" charset="utf-8"></script>

<script>
jQuery(document).ready(function(){
	// binds form submission and fields to the validation engine
	jQuery("#request").validationEngine('attach');

	$("#request").bind("jqv.form.validating", function(event){
		$("#hookError").html("")
	})

	$("#request").bind("jqv.form.result", function(event , errorFound){
		if(errorFound) $("#hookError").append("There is some problems with your form");
	})

});
</script>

<?php
include ("authenticate.php");
authenticate();
require ('js/pdo_connection.php');
require ('config.php');
?>

<div class="white-popup-add-asset">

<br><br><br>
<form name="window_add_asset.php" method="post" id="request">

			<b>Asset Information</b>
			<table width="700">
				<tr>
					<td><b>Asset Tag:</b></td>
					<td><input class="validate[required] searchfield" type="text" name="asset" value=""></td>
					<td><b>Serial Tag:</b></td>
					<td><input class="validate[required] searchfield" type="text" name="serial" value=""></td>
				</tr>
				<tr>
					<td><b>Model:</b></td><td>
					<?php
					
					pdo_connection($open_inventory_connection,$open_inventory_database);

$query = "SELECT names FROM model ORDER BY names ASC";

$result = $db->query($query);
$error = $db->errorInfo();
if (!is_null($error[2])) {
    echo "Query failed! " . $error[2];
}
?>
<select name="model" class="validate[required] searchfield">
<option value= "" selected value=""></option>
<?php
while($data = $result->fetch(PDO::FETCH_ASSOC)) {

  $model = htmlentities($data['names']);
  echo '<option value="'.$model.'">'.$model."</option>\n";
}
$result->closeCursor();
$db = null;
?>
</select>
                    
                    </td>
					<td><b>Operating System:</b></td><td>
					
                <?php
 					pdo_connection($open_inventory_connection,$open_inventory_database);

$query = "SELECT names FROM os ORDER BY names ASC";

$result = $db->query($query);
$error = $db->errorInfo();
if (!is_null($error[2])) {
    echo "Query failed! " . $error[2];
}

?>
<select name="os" class="validate[required] searchfield">
<option value= "" selected value=""></option>
<?php
while($data = $result->fetch(PDO::FETCH_ASSOC)) {

  $os = htmlentities($data['names']);
  echo '<option value="'.$os.'">'.$os."</option>\n";
}
$result->closeCursor();
$db = null;
?>
</select>           
                </td>  
				</tr>
				<tr>
					<td><b>Date Setup:</b></td>
                   <?php $date = date("Y-m-d");
				   ?>
                    <td><input class="searchfield" type="text" name="datesetup" value="<?php echo $date ?>"></td>
										<td><b>Asigned Too:</b></td>
					<td>inv</td>
				</tr>
			</table>

            <br />
			            <br />
            <input class="button" type="submit" name="form" value="Add Asset">
            </form>
            			<?php

if($_SERVER['REQUEST_METHOD'] == "POST") {

pdo_connection($open_inventory_connection,$open_inventory_database);
 
  	$assetname_exists = assetname_check($_POST['asset']);
	$serial_exists = serial_check($_POST['serial']);

if ($assetname_exists != 1){
 echo "$assetname_exists";
 break; } 
 else if ($serial_exists != 1){
 echo "$serial_exists";
 break; } else
  $type = "Add Computer";
  $changedate = date("Y-m-d H:i:s");
  $model = $_POST['model'];
  $os = $_POST['os'];
  $asset = trim(strtoupper($_POST['asset']));
  $serial = trim(strtoupper($_POST['serial']));
  $setupdate = $changedate;
$asignedto = "inv";
$status = "Restore";

	$sql = "INSERT INTO atsassets 
(asset, serial, model, os, lastupdate, datesetup, setupdate, asignedto, status) 
VALUES 
(:asset, :serial, :model, :os, :lastupdate, :datesetup, :setupdate, :asignedto, :status)";
try
{
$qeury = $db->prepare($sql);
$qeury->execute(array(
':asset'=>$asset,
':serial'=>$serial,
':model'=>$model,
':os'=>$os,
':lastupdate'=>$date,
':datesetup'=>$date,
':setupdate'=>$date,
':asignedto'=>$asignedto,
':status'=>$status

));
}
catch(PDOException $e)
{
echo 'Query failed'.$e->getMessage();
} 
  
$byuser = $_SERVER['REMOTE_USER'];
  
  	$sql = "INSERT INTO logs 
(type, asset, serial, model, os, datesetup, changedate, asignedto, byuser, setupdate) 
VALUES 
(:type, :asset, :serial, :model, :os, :datesetup, :changedate, :asignedto, :byuser, :setupdate)";

try
{
$qeury = $db->prepare($sql);
$qeury->execute(array(
':type'=>$type,
':asset'=>$asset,
':serial'=>$serial,
':model'=>$model,
':os'=>$os,
':datesetup'=>$date,
':changedate'=>$changedate,
':asignedto'=>$asignedto,
':byuser'=>$byuser,
':setupdate'=>$setupdate
));
}
catch(PDOException $e)
{
echo 'Query failed'.$e->getMessage();
} 
  
echo "<br /><center><b>Record has been added</b><center>";
$db = null;	
}
?>

</div>

Open in new window

0
 
LVL 82

Expert Comment

by:leakim971
Comment Utility
please provide a link to see your page OR do a right click on your page and post the content

don't post php code
0
 

Author Comment

by:ats2012
Comment Utility
Here is the page source from Chrome:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ATS Management</title>
<link rel="shortcut icon" href="images/ats_logo_new.ico">

<link href="css/templatemo_style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="css/ddsmoothmenu.css" />
<link rel="stylesheet" type="text/css" href="css/magnific-popup.css" />

<script type="text/javascript" src="js/jquery1.9.js"></script>

<script type="text/javascript" src="js/jquery.magnific-popup-inline.js"></script>		
<script type="text/javascript" src="js/ddsmoothmenu.js"></script>

<script language="javascript" type="text/javascript">
function clearText(field)
{
    if (field.defaultValue == field.value) field.value = '';
    else if (field.value == '') field.value = field.defaultValue;
}
</script>

<script type="text/javascript">

ddsmoothmenu.init({
	mainmenuid: "templatemo_menu", //menu DIV id
	orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
	classname: 'ddsmoothmenu', //class added to menu's outer DIV
	//customtheme: ["#1c5a80", "#18374a"],
	contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
})
</script> 



</head>

<body>

<div id="templatemo_header_wrapper">
    <div id="templatemo_header">
        <div id="site_title"><a href="index.php"><img id="logo" src="images/ats_logo_new.png"/></a>
			
		
		</div>
		<div id="search">
		<form action="results.php" method="get" id="search_form">
	<input class="searchfield" type="text" name="search" value="Search..." onfocus="if (this.value == 'Search...') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search...';}" />
	<input class="searchbutton" type="submit" value="Go"/>

</form>
		</div>
        <div id="templatemo_menu" class="ddsmoothmenu">
            <ul>
                <li><a href="index.php" class="selected">Assets</a>
                    <ul>
                        <li><span class="top"></span><span class="bottom"></span></li>
                        <li><a rel="nofollow" href="window_add_asset.php" class="open-popup-add-asset">Add Asset</a></li>
<script type="text/javascript">
$('.open-popup-add-asset').magnificPopup({
  type:'ajax',
  closeOnBgClick: false,
  overflowY: 'scroll'
});
</script>
						<li><a href="window_cisco.php" class="open-popup-cisco">Cisco Equipment</a></li>
<script type="text/javascript">
$('.open-popup-cisco').magnificPopup({
  type:'ajax',
  closeOnBgClick: false,
  overflowY: 'scroll'
});
</script>
                  	</ul>
                </li>
                <li><a href="users.php">Users</a>
                    <ul>
                        <li><span class="top"></span><span class="bottom"></span></li>
                        <li><a rel="nofollow" href="add_user.php">Add User</a></li>
                        <li><a href="window_user_waiting.php" class="open-popup-user-waiting">Approve New Users</a></li>
<script type="text/javascript">
$('.open-popup-user-waiting').magnificPopup({
  type:'ajax',
  closeOnBgClick: false,
  overflowY: 'scroll'
});
</script>
                  	</ul>
                </li>
				<li><a href="">Monitors</a>
                    <ul>
                        <li><span class="top"></span><span class="bottom"></span></li>
                        <li><a rel="nofollow" href="http://www.templatemo.com/page/1">Add Monitor</a></li>
                        <li><a rel="nofollow" href="http://www.templatemo.com/page/2">Edit Monitors</a></li>
						li><a rel="nofollow" href="http://www.templatemo.com/page/2">Available Monitors</a></li>
                  	</ul>
                </li>
				<li><a href="">Other</a>
                    <ul>
                        <li><span class="top"></span><span class="bottom"></span></li>
                        <li><a rel="nofollow" href="http://www.templatemo.com/page/2">Checkout Equipment</a></li>
						<li><a rel="nofollow" href="http://www.templatemo.com/page/2">Reports</a></li>
						<li><a rel="nofollow" href="http://www.templatemo.com/page/2">Logs</a></li>
						<li><a rel="nofollow" href="http://www.templatemo.com/page/2">Add Department</a></li>
						<li><a rel="nofollow" href="http://www.templatemo.com/page/2">Add Models</a></li>
						<li><a rel="nofollow" href="http://www.templatemo.com/page/2">Add OS</a></li>
						<li><a rel="nofollow" href="http://www.templatemo.com/page/2">Printers</a></li>
						<li><a rel="nofollow" href="http://www.templatemo.com/page/2">Replacements</a></li>
                  	</ul>
                </li>
            </ul>
            <br style="clear: left" />
        </div> <!-- end of templatemo_menu -->
    </div> <!-- END of header -->
</div>

<div id="templatemo_main_top"></div>
<div id="templatemo_main">

	    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript">
      google.load("visualization", "1", {packages:["corechart"]});
      google.setOnLoadCallback(drawChart);
	  google.setOnLoadCallback(drawChart_os);
	  google.setOnLoadCallback(drawChart_line);
	  
	        function drawChart_line() {
        var data = google.visualization.arrayToDataTable([
          ['Day', 'Assets'],
		  		  
          ['2014-02-27',  3],

		  		  
          ['2014-02-26',  4],

		  		  
          ['2014-02-25',  4],

		  		  
          ['2014-02-24',  1],

		  		  
          ['2014-02-23',  0],

		  		  
          ['2014-02-22',  0],

		  		  
          ['2014-02-21',  2],

		  		  
          ['2014-02-20',  1],

		  		  
          ['2014-02-19',  1],

		  		  
          ['2014-02-18',  0],

		  		  
          ['2014-02-17',  3],

		  		  
          ['2014-02-16',  0],

		  		  
          ['2014-02-15',  0],

		  		  
          ['2014-02-14',  1],

		  		  
          ['2014-02-13',  6],

		  		  
          ['2014-02-12',  1],

		  		  
          ['2014-02-11',  0],

		  		  
          ['2014-02-10',  1],

		  		  
          ['2014-02-9',  0],

		  		  
          ['2014-02-8',  0],

		  		  
          ['2014-02-7',  4],

		  		  
          ['2014-02-6',  0],

		  		  
          ['2014-02-5',  8],

		  		  
          ['2014-02-4',  0],

		  		  
          ['2014-02-3',  0],

		  		  
          ['2014-02-2',  0],

		  		  
          ['2014-02-1',  0],

		  		  
          ['2014-01-31',  1],

		  		  
          ['2014-01-30',  2],

		  		  
          ['2014-01-29',  2],

		  		  
          ['2014-01-28',  6],

		          ]);

        var options = {
		backgroundColor: '#D6D6CE',
          title: 'Deployed Assets - Last 30 days'
        };

        var chart = new google.visualization.LineChart(document.getElementById('chart_div_line'));
        chart.draw(data, options);
      }
	  	  
	  
      function drawChart() {
        var data = google.visualization.arrayToDataTable([
          ['Task', 'Hours per Day'],
          ['Assets Ready for Deployment',     2],
          ['Assets Needing to be Restored',      16],
          ['Development Machines',  2],
          ['Available Monitors', 11],
          ['Unasigned Assets',    15]
        ]);

        var options = {
		backgroundColor: '#D6D6CE',
          title: 'Asset Overview',
		  is3D: true
        };

        var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
        chart.draw(data, options);
      }
	  
	  	        function drawChart_os() {
        var data_bar = google.visualization.arrayToDataTable([
          ['Operating Systems', 'Windows XP', 'Windows 7','Windows Server 2003','Windows Server 2008','Windows Server 2012'],
          ['Total',  151,415,27,15,1]
        ]);

        var options_bar = {
		backgroundColor: '#D6D6CE',
          title: 'Operating Systems',
        };

        var chart = new google.visualization.ColumnChart(document.getElementById('chart_div_two'));
        chart.draw(data_bar, options_bar);
      }

    </script>
 <table border="0">
  <tr>
  <td>
    <div id="chart_div" style="width: 450px; height: 200px;"></div>
	</td>
	<td>
	<div id="chart_div_two" style="width: 450px; height: 200px;"></div>
	</td>
</tr>
  <tr>
  <td colspan="2">
    <div id="chart_div_line" style="width: 900px; height: 270px;"></div>
	</td>
	<td>
	</td>
</tr>
</table>

<br>
    <div class="fp_box5">
		<a href="window_assets_ready.php" class="open-popup-ready">
        <img id="logo" src="images/navigation/computer_deploy.png" width='45' height='45'/>
        <h2>Assets Ready for Deployment</a></h2>
        <center><h5>2</h5></center>
    </div>
	<script type="text/javascript">
$('.open-popup-ready').magnificPopup({
  type:'ajax',
  closeOnBgClick: false,
  overflowY: 'scroll'
});
</script> 
    <div class="fp_box5">
		<a href="window_assets_restore.php" class="open-popup-restore">
        <img id="logo" src="images/navigation/computer_restore.png" width='45' height='45'/>
        <h2>Assets Needing to be Restored</a></h2>
        <center><h5>16</h5></center>
    </div>
<script type="text/javascript">
$('.open-popup-restore').magnificPopup({
  type:'ajax',
  closeOnBgClick: false,
  overflowY: 'scroll'
});
</script>
    <div class="fp_box5">
		<a href="window_monitors.php" class="open-popup-monitor">
        <img id="logo" src="images/navigation/monitor2.png" width='45' height='45'/>
        <h2>Monitors Available</a></h2><br>
        <center><h5>11</h5></center>
    </div>
	<script type="text/javascript">
$('.open-popup-monitor').magnificPopup({
  type:'ajax',
  closeOnBgClick: false,
  overflowY: 'scroll'
});
</script>
    <div class="fp_box5">
		<a href="window_assets_unassigned.php" class="open-popup-unassigned">
        <img id="logo" src="images/navigation/computer_unasigned.png" width='45' height='45'/>
        <h2>Unassigned Assets</a></h2><br>
        <center><h5>15</h5></center>
    </div>
<script type="text/javascript">
$('.open-popup-unassigned').magnificPopup({
  type:'ajax',
  closeOnBgClick: false,
  overflowY: 'scroll'
});
</script>
	<div class="fp_box5">
		<a href="window_assets_develop.php" class="open-popup-develop">
        <img id="logo" src="images/navigation/computer_development.png" width='45' height='45'/>
        <h2>Development Machines</a></h2>
		<br>
        <center><h5>2</h5></center>
    </div>
<script type="text/javascript">
$('.open-popup-develop').magnificPopup({
  type:'ajax',
  closeOnBgClick: false,
  overflowY: 'scroll'
});
</script>

    <div class="cleaner h0"></div>
	<!--
    <div class="col_12 float_l">
    	<h2>Welcome To Work Center</h2>
        
        <p><em>Nunc dictum cursus laoreet. Cras dapibus quam sed dolor rhoncus tincidunt.</em></p>
        <p><a href="http://www.templatemo.com" rel="nofollow" target="_parent">Work Center</a> is  free css template provided by <a href="http://www.templatemo.com" rel="nofollow">templatemo.com</a> for your personal or commercial websites. Cras vulputate laoreet porta. In mi enim, pulvinar vitae vehicula vestibulum, fringilla quis risus. Fusce vel mi mi, ac mollis nisi. Mauris mollis fringilla molestie. Nunc a libero elit, at dignissim elit. </p>
    </div>
    <div class="col_12 float_r">
    	<h2>Web Technologies</h2>
        
        <p><em>Sed imperdiet fermentum sagittis. Donec ut diam sed enim dapibus id non metus.</em></p>
        <p>Donec est dolor, pharetra ac consectetur vel, pretium nec dui. Duis dignissim viverra nisi vitae molestie. Proin pulvinar accumsan leo, id rutrum dui consequat quis. Sed at risus quis eros venenatis semper. Quisque neque tellus, dignissim sed ac nunc. Phasellus vitae tellus metus nulla. Validate <a href="http://validator.w3.org/check?uri=referer" rel="nofollow"><strong>XHTML</strong></a> &amp; <a href="http://jigsaw.w3.org/css-validator/check/referer" rel="nofollow"><strong>CSS</strong></a>.</p>	

	</div>
	
    
    <div class="cleaner"></div> -->
</div> <!-- END of main -->





<div id="templatemo_footer_wrapper">
	<div id="templatemo_footer">
	
		<div class="col col_14">
        	<h5>Assets</h5>
            <ul class="footer_list">
                <li><a rel="nofollow" href="window_add_asset.php" class="open-popup-add-asset">Add Asset</a></li>
<script type="text/javascript">
$('.open-popup-add-asset').magnificPopup({
  type:'ajax',
  closeOnBgClick: false,
  overflowY: 'scroll'
});
</script>				
            	<li><a href="window_cisco.php" class="open-popup-cisco">Cisco Equipment</a></li>
<script type="text/javascript">
$('.open-popup-cisco').magnificPopup({
  type:'ajax',
  closeOnBgClick: false,
  overflowY: 'scroll'
});
</script>
			</ul>   
        </div>
        <div class="col col_14">
        	<h5>Users</h5>
            <ul class="footer_list">
            	<li><a href="add_user.php">Add User</a></li>
                <li><a href="window_user_waiting.php" class="open-popup-user-waiting">Approve New Users</a></li>
			</ul>
        </div>
<script type="text/javascript">
$('.open-popup-user-waiting').magnificPopup({
  type:'ajax',
  closeOnBgClick: false,
  overflowY: 'scroll'
});
</script> 
        <div class="col col_14">
        	<h5>Monitors</h5>	
            <ul class="footer_list">
                <li><a href="#" class="social facebook">Add Monitor</a></li>
                <li><a href="#" class="social twitter">Edit Monitors</a></li>
			</ul>
        </div>
		
        <div class="col col_14 no_margin_right">
        	<h5>Other</h5>	
            <ul class="footer_list">
                <li><a href="#" class="social feed">Checkout Equipment</a></li>
				<li><a href="#" class="social feed">Reports</a></li>
				<li><a href="#" class="social feed">Logs</a></li>
				<li><a href="#" class="social feed">Printers</a></li>
				<li><a href="#" class="social feed">Replacements</a></li>
			</ul>
        </div>
        
    <div class="cleaner"></div>
    </div>
</div> <!-- END of footer -->

</body>
</html>

Open in new window

0
 
LVL 82

Expert Comment

by:leakim971
Comment Utility
imagine in your main page you have somewhere :
var a = 10;
As long << a = 10 >> you can submit your page
Now in your popup you've some javascript code saying : a = 20

a is jQuery

Don't load multiple time resources in your page.
Load them

in window_add_asset.php remove :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<link href="css/templatemo_style.css" rel="stylesheet" type="text/css" />

<script type="text/javascript" src="js/jquery.js"></script>

<link rel="stylesheet" href="css/validationEngine.jquery.css" type="text/css"/>


<script src="js/validate/languages/jquery.validationEngine-en.js" type="text/javascript" charset="utf-8"></script>
<script src="js/validate/jquery.validationEngine.js" type="text/javascript" charset="utf-8"></script>

Open in new window


AND :

</body>
</html>

Open in new window


If you need jquery.validationEngine fileSSSS, put them in the main page
If you need templatemo_style.css put it in the main page
0
 

Author Comment

by:ats2012
Comment Utility
I removed everything and moved it to the main page and when I load the page, validation still works but when i type in the form and click submit its not running the below. The page just closes.


if($_SERVER['REQUEST_METHOD'] == "POST") {

{
0
 
LVL 82

Expert Comment

by:leakim971
Comment Utility
let me see the two page now (html for main, php for window_add_asset.php
0
 

Author Comment

by:ats2012
Comment Utility
Main:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ATS Management</title>
<link rel="shortcut icon" href="images/ats_logo_new.ico">

<link href="css/templatemo_style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="css/validationEngine.jquery.css" type="text/css"/>
<link href="css/templatemo_style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="css/ddsmoothmenu.css" />
<link rel="stylesheet" type="text/css" href="css/magnific-popup.css" />

<script type="text/javascript" src="js/jquery.js"></script>

<script src="js/validate/languages/jquery.validationEngine-en.js" type="text/javascript" charset="utf-8"></script>
<script src="js/validate/jquery.validationEngine.js" type="text/javascript" charset="utf-8"></script>

<script type="text/javascript" src="js/jquery.magnific-popup-inline.js"></script>		
<script type="text/javascript" src="js/ddsmoothmenu.js"></script>

<script language="javascript" type="text/javascript">
function clearText(field)
{
    if (field.defaultValue == field.value) field.value = '';
    else if (field.value == '') field.value = field.defaultValue;
}
</script>

<script type="text/javascript">

ddsmoothmenu.init({
	mainmenuid: "templatemo_menu", //menu DIV id
	orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
	classname: 'ddsmoothmenu', //class added to menu's outer DIV
	//customtheme: ["#1c5a80", "#18374a"],
	contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
})
</script> 



</head>

<body>

<div id="templatemo_header_wrapper">
    <div id="templatemo_header">
        <div id="site_title"><a href="index.php"><img id="logo" src="images/ats_logo_new.png"/></a>
			
		
		</div>
		<div id="search">
		<form action="results.php" method="get" id="search_form">
	<input class="searchfield" type="text" name="search" value="Search..." onfocus="if (this.value == 'Search...') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search...';}" />
	<input class="searchbutton" type="submit" value="Go"/>

</form>
		</div>
        <div id="templatemo_menu" class="ddsmoothmenu">
            <ul>
                <li><a href="index.php" class="selected">Assets</a>
                    <ul>
                        <li><span class="top"></span><span class="bottom"></span></li>
                        <li><a rel="nofollow" href="window_add_asset.php" class="open-popup-add-asset">Add Asset</a></li>
<script type="text/javascript">
$('.open-popup-add-asset').magnificPopup({
  type:'ajax',
  closeOnBgClick: false,
  overflowY: 'scroll'
});
</script>
						<li><a href="window_cisco.php" class="open-popup-cisco">Cisco Equipment</a></li>
<script type="text/javascript">
$('.open-popup-cisco').magnificPopup({
  type:'ajax',
  closeOnBgClick: false,
  overflowY: 'scroll'
});
</script>
                  	</ul>
                </li>
                <li><a href="users.php">Users</a>
                    <ul>
                        <li><span class="top"></span><span class="bottom"></span></li>
                        <li><a rel="nofollow" href="add_user.php">Add User</a></li>
                        <li><a href="window_user_waiting.php" class="open-popup-user-waiting">Approve New Users</a></li>
<script type="text/javascript">
$('.open-popup-user-waiting').magnificPopup({
  type:'ajax',
  closeOnBgClick: false,
  overflowY: 'scroll'
});
</script>
                  	</ul>
                </li>
				<li><a href="">Monitors</a>
                    <ul>
                        <li><span class="top"></span><span class="bottom"></span></li>
                        <li><a rel="nofollow" href="http://www.templatemo.com/page/1">Add Monitor</a></li>
                        <li><a rel="nofollow" href="http://www.templatemo.com/page/2">Edit Monitors</a></li>
						<li><a rel="nofollow" href="http://www.templatemo.com/page/2">Available Monitors</a></li>
                  	</ul>
                </li>
				<li><a href="">Other</a>
                    <ul>
                        <li><span class="top"></span><span class="bottom"></span></li>
                        <li><a rel="nofollow" href="http://www.templatemo.com/page/2">Checkout Equipment</a></li>
						<li><a rel="nofollow" href="http://www.templatemo.com/page/2">Reports</a></li>
						<li><a rel="nofollow" href="http://www.templatemo.com/page/2">Logs</a></li>
						<li><a rel="nofollow" href="http://www.templatemo.com/page/2">Add Department</a></li>
						<li><a rel="nofollow" href="http://www.templatemo.com/page/2">Add Models</a></li>
						<li><a rel="nofollow" href="http://www.templatemo.com/page/2">Add OS</a></li>
						<li><a rel="nofollow" href="http://www.templatemo.com/page/2">Printers</a></li>
						<li><a rel="nofollow" href="http://www.templatemo.com/page/2">Replacements</a></li>
                  	</ul>
                </li>
            </ul>
            <br style="clear: left" />
        </div> <!-- end of templatemo_menu -->
    </div> <!-- END of header -->
</div>

<div id="templatemo_main_top">

    <div class="fp_box4">
		<a href="window_assets_ready.php" class="open-popup-ready">
        <img id="logo" src="images/navigation/add_asset.png" width='30' height='30'/>
        <h2>Add Asset</a></h2>
    </div>
	<div class="fp_box4">
		<a href="window_cisco.php" class="open-popup-cisco">
        <img id="logo" src="images/cisco.png" width='30' height='30'/>
        <h2>Cisco Equipment</a></h2>
    </div>
<script type="text/javascript">
$('.open-popup-cisco').magnificPopup({
  type:'ajax',
  closeOnBgClick: false,
  overflowY: 'scroll'
});
</script>

</div>
<div id="templatemo_main">

	    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript">
      google.load("visualization", "1", {packages:["corechart"]});
      google.setOnLoadCallback(drawChart);
	  google.setOnLoadCallback(drawChart_os);
	  google.setOnLoadCallback(drawChart_line);
	  
	        function drawChart_line() {
        var data = google.visualization.arrayToDataTable([
          ['Day', 'Assets'],
		  		  
          ['2014-02-27',  3],

		  		  
          ['2014-02-26',  4],

		  		  
          ['2014-02-25',  4],

		  		  
          ['2014-02-24',  1],

		  		  
          ['2014-02-23',  0],

		  		  
          ['2014-02-22',  0],

		  		  
          ['2014-02-21',  2],

		  		  
          ['2014-02-20',  1],

		  		  
          ['2014-02-19',  1],

		  		  
          ['2014-02-18',  0],

		  		  
          ['2014-02-17',  3],

		  		  
          ['2014-02-16',  0],

		  		  
          ['2014-02-15',  0],

		  		  
          ['2014-02-14',  1],

		  		  
          ['2014-02-13',  6],

		  		  
          ['2014-02-12',  1],

		  		  
          ['2014-02-11',  0],

		  		  
          ['2014-02-10',  1],

		  		  
          ['2014-02-9',  0],

		  		  
          ['2014-02-8',  0],

		  		  
          ['2014-02-7',  4],

		  		  
          ['2014-02-6',  0],

		  		  
          ['2014-02-5',  8],

		  		  
          ['2014-02-4',  0],

		  		  
          ['2014-02-3',  0],

		  		  
          ['2014-02-2',  0],

		  		  
          ['2014-02-1',  0],

		  		  
          ['2014-01-31',  1],

		  		  
          ['2014-01-30',  2],

		  		  
          ['2014-01-29',  2],

		  		  
          ['2014-01-28',  6],

		          ]);

        var options = {
		backgroundColor: '#D6D6CE',
          title: 'Deployed Assets - Last 30 days'
        };

        var chart = new google.visualization.LineChart(document.getElementById('chart_div_line'));
        chart.draw(data, options);
      }
	  	  
	  
      function drawChart() {
        var data = google.visualization.arrayToDataTable([
          ['Task', 'Hours per Day'],
          ['Assets Ready for Deployment',     2],
          ['Assets Needing to be Restored',      16],
          ['Development Machines',  2],
          ['Available Monitors', 11],
          ['Unasigned Assets',    15]
        ]);

        var options = {
		backgroundColor: '#D6D6CE',
          title: 'Asset Overview',
		  is3D: true
        };

        var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
        chart.draw(data, options);
      }
	  
	  	        function drawChart_os() {
        var data_bar = google.visualization.arrayToDataTable([
          ['Operating Systems', 'Windows XP', 'Windows 7','Windows Server 2003','Windows Server 2008','Windows Server 2012'],
          ['Total',  151,415,27,15,1]
        ]);

        var options_bar = {
		backgroundColor: '#D6D6CE',
          title: 'Operating Systems',
        };

        var chart = new google.visualization.ColumnChart(document.getElementById('chart_div_two'));
        chart.draw(data_bar, options_bar);
      }

    </script>
 <table border="0">
  <tr>
  <td>
    <div id="chart_div" style="width: 450px; height: 180px;"></div>
	</td>
	<td>
	<div id="chart_div_two" style="width: 450px; height: 180px;"></div>
	</td>
</tr>
  <tr>
  <td colspan="2">
    <div id="chart_div_line" style="width: 900px; height: 270px;"></div>
	</td>
	<td>
	</td>
</tr>
</table>

<br>
    <div class="fp_box5">
		<a href="window_assets_ready.php" class="open-popup-ready">
        <img id="logo" src="images/navigation/computer_deploy.png" width='45' height='45'/>
        <h2>Assets Ready for Deployment</a></h2>
        <center><h5>2</h5></center>
    </div>
	<script type="text/javascript">
$('.open-popup-ready').magnificPopup({
  type:'ajax',
  closeOnBgClick: false,
  overflowY: 'scroll'
});
</script> 
    <div class="fp_box5">
		<a href="window_assets_restore.php" class="open-popup-restore">
        <img id="logo" src="images/navigation/computer_restore.png" width='45' height='45'/>
        <h2>Assets Needing to be Restored</a></h2>
        <center><h5>16</h5></center>
    </div>
<script type="text/javascript">
$('.open-popup-restore').magnificPopup({
  type:'ajax',
  closeOnBgClick: false,
  overflowY: 'scroll'
});
</script>
    <div class="fp_box5">
		<a href="window_monitors.php" class="open-popup-monitor">
        <img id="logo" src="images/navigation/monitor2.png" width='45' height='45'/>
        <h2>Monitors Available</a></h2><br>
        <center><h5>11</h5></center>
    </div>
	<script type="text/javascript">
$('.open-popup-monitor').magnificPopup({
  type:'ajax',
  closeOnBgClick: false,
  overflowY: 'scroll'
});
</script>
    <div class="fp_box5">
		<a href="window_assets_unassigned.php" class="open-popup-unassigned">
        <img id="logo" src="images/navigation/computer_unasigned.png" width='45' height='45'/>
        <h2>Unassigned Assets</a></h2><br>
        <center><h5>15</h5></center>
    </div>
<script type="text/javascript">
$('.open-popup-unassigned').magnificPopup({
  type:'ajax',
  closeOnBgClick: false,
  overflowY: 'scroll'
});
</script>
	<div class="fp_box5">
		<a href="window_assets_develop.php" class="open-popup-develop">
        <img id="logo" src="images/navigation/computer_development.png" width='45' height='45'/>
        <h2>Development Machines</a></h2>
		<br>
        <center><h5>2</h5></center>
    </div>
<script type="text/javascript">
$('.open-popup-develop').magnificPopup({
  type:'ajax',
  closeOnBgClick: false,
  overflowY: 'scroll'
});
</script>

    <div class="cleaner h0"></div>

</div> <!-- END of main -->
<div id="templatemo_footer_wrapper">
	<div id="templatemo_footer">
	
		<div class="col col_14">
        	<h5>Assets</h5>
            <ul class="footer_list">
                <li><a rel="nofollow" href="window_add_asset.php" class="open-popup-add-asset">Add Asset</a></li>
<script type="text/javascript">
$('.open-popup-add-asset').magnificPopup({
  type:'ajax',
  closeOnBgClick: false,
  overflowY: 'scroll'
});
</script>				
            	<li><a href="window_cisco.php" class="open-popup-cisco">Cisco Equipment</a></li>
<script type="text/javascript">
$('.open-popup-cisco').magnificPopup({
  type:'ajax',
  closeOnBgClick: false,
  overflowY: 'scroll'
});
</script>
			</ul>   
        </div>
        <div class="col col_14">
        	<h5>Users</h5>
            <ul class="footer_list">
            	<li><a href="add_user.php">Add User</a></li>
                <li><a href="window_user_waiting.php" class="open-popup-user-waiting">Approve New Users</a></li>
			</ul>
        </div>
<script type="text/javascript">
$('.open-popup-user-waiting').magnificPopup({
  type:'ajax',
  closeOnBgClick: false,
  overflowY: 'scroll'
});
</script> 
        <div class="col col_14">
        	<h5>Monitors</h5>	
            <ul class="footer_list">
                <li><a href="#" class="social facebook">Add Monitor</a></li>
                <li><a href="#" class="social twitter">Edit Monitors</a></li>
			</ul>
        </div>
		
        <div class="col col_14 no_margin_right">
        	<h5>Other</h5>	
            <ul class="footer_list">
                <li><a href="#" class="social feed">Checkout Equipment</a></li>
				<li><a href="#" class="social feed">Reports</a></li>
				<li><a href="#" class="social feed">Logs</a></li>
				<li><a href="#" class="social feed">Printers</a></li>
				<li><a href="#" class="social feed">Replacements</a></li>
			</ul>
        </div>
        
    <div class="cleaner"></div>
    </div>
</div> <!-- END of footer -->

</body>
</html>

Open in new window



Window Page:

<?php
 function assetname_check($assetname){
 
$db = new PDO("mysql:host=localhost;dbname=ats", "root", "pass");
 
 
$stmt = $db->prepare("SELECT asset FROM atsassets WHERE asset = :asset_name");
$stmt->bindParam('asset_name', $assetname);
$stmt->execute();

$result = $stmt->fetch();

$db = null;

 if (!empty($result)){
  return "<center><b>Asset already exsists in Database</b></center>";
 }else{
  return 1;
 }
 
}

 function serial_check($serial){
 
 $db = new PDO("mysql:host=localhost;dbname=ats", "root", "pass");
 
$stmt = $db->prepare("SELECT serial FROM atsassets WHERE serial = :serial_number");
$stmt->bindParam('serial_number', $serial);
$stmt->execute();

$result = $stmt->fetch();

$db = null;

 if (!empty($result)){
  return "<center><b>Serial already exsists in Database</b></center>";
 }else{
  return 1;
 }
 
}


?>

<script>
jQuery(document).ready(function(){
	// binds form submission and fields to the validation engine
	jQuery("#request").validationEngine('attach');

	$("#request").bind("jqv.form.validating", function(event){
		$("#hookError").html("")
	})

	$("#request").bind("jqv.form.result", function(event , errorFound){
		if(errorFound) $("#hookError").append("There is some problems with your form");
	})

});
</script>

<?php
include ("authenticate.php");
authenticate();
require ('js/pdo_connection.php');
require ('config.php');
?>

<div class="white-popup-add-asset">

<br><br><br>
<form name="window_add_asset.php" method="post" id="request">

			<b>Asset Information</b>
			<table width="700">
				<tr>
					<td><b>Asset Tag:</b></td>
					<td><input class="validate[required] searchfield" type="text" name="asset" value=""></td>
					<td><b>Serial Tag:</b></td>
					<td><input class="validate[required] searchfield" type="text" name="serial" value=""></td>
				</tr>
				<tr>
					<td><b>Model:</b></td><td>
					<?php
					
					pdo_connection($open_inventory_connection,$open_inventory_database);

$query = "SELECT names FROM model ORDER BY names ASC";

$result = $db->query($query);
$error = $db->errorInfo();
if (!is_null($error[2])) {
    echo "Query failed! " . $error[2];
}
?>
<select name="model" class="validate[required] searchfield">
<option value= "" selected value=""></option>
<?php
while($data = $result->fetch(PDO::FETCH_ASSOC)) {

  $model = htmlentities($data['names']);
  echo '<option value="'.$model.'">'.$model."</option>\n";
}
$result->closeCursor();
$db = null;
?>
</select>
                    
                    </td>
					<td><b>Operating System:</b></td><td>
					
                <?php
 					pdo_connection($open_inventory_connection,$open_inventory_database);

$query = "SELECT names FROM os ORDER BY names ASC";

$result = $db->query($query);
$error = $db->errorInfo();
if (!is_null($error[2])) {
    echo "Query failed! " . $error[2];
}

?>
<select name="os" class="validate[required] searchfield">
<option value= "" selected value=""></option>
<?php
while($data = $result->fetch(PDO::FETCH_ASSOC)) {

  $os = htmlentities($data['names']);
  echo '<option value="'.$os.'">'.$os."</option>\n";
}
$result->closeCursor();
$db = null;
?>
</select>           
                </td>  
				</tr>
				<tr>
					<td><b>Date Setup:</b></td>
                   <?php $date = date("Y-m-d");
				   ?>
                    <td><input class="searchfield" type="text" name="datesetup" value="<?php echo $date ?>"></td>
										<td><b>Asigned Too:</b></td>
					<td>inv</td>
				</tr>
			</table>

            <br />
			            <br />
            <input class="button" type="submit" name="form" value="Add Asset">
            </form>
            			<?php

if($_SERVER['REQUEST_METHOD'] == "POST") {

pdo_connection($open_inventory_connection,$open_inventory_database);
 
  	$assetname_exists = assetname_check($_POST['asset']);
	$serial_exists = serial_check($_POST['serial']);

if ($assetname_exists != 1){
 echo "$assetname_exists";
 break; } 
 else if ($serial_exists != 1){
 echo "$serial_exists";
 break; } else
  $type = "Add Computer";
  $changedate = date("Y-m-d H:i:s");
  $model = $_POST['model'];
  $os = $_POST['os'];
  $asset = trim(strtoupper($_POST['asset']));
  $serial = trim(strtoupper($_POST['serial']));
  $setupdate = $changedate;
$asignedto = "inv";
$status = "Restore";

	$sql = "INSERT INTO atsassets 
(asset, serial, model, os, lastupdate, datesetup, setupdate, asignedto, status) 
VALUES 
(:asset, :serial, :model, :os, :lastupdate, :datesetup, :setupdate, :asignedto, :status)";
try
{
$qeury = $db->prepare($sql);
$qeury->execute(array(
':asset'=>$asset,
':serial'=>$serial,
':model'=>$model,
':os'=>$os,
':lastupdate'=>$date,
':datesetup'=>$date,
':setupdate'=>$date,
':asignedto'=>$asignedto,
':status'=>$status

));
}
catch(PDOException $e)
{
echo 'Query failed'.$e->getMessage();
} 
  
$byuser = $_SERVER['REMOTE_USER'];
  
  	$sql = "INSERT INTO logs 
(type, asset, serial, model, os, datesetup, changedate, asignedto, byuser, setupdate) 
VALUES 
(:type, :asset, :serial, :model, :os, :datesetup, :changedate, :asignedto, :byuser, :setupdate)";

try
{
$qeury = $db->prepare($sql);
$qeury->execute(array(
':type'=>$type,
':asset'=>$asset,
':serial'=>$serial,
':model'=>$model,
':os'=>$os,
':datesetup'=>$date,
':changedate'=>$changedate,
':asignedto'=>$asignedto,
':byuser'=>$byuser,
':setupdate'=>$setupdate
));
}
catch(PDOException $e)
{
echo 'Query failed'.$e->getMessage();
} 
  
echo "<br /><center><b>Record has been added</b><center>";
$db = null;	
}
?>

</div>

Open in new window

0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 82

Expert Comment

by:leakim971
Comment Utility
Wrap the << Window Page: >> code with :<badtag></badtag>

<badtag>

content of Window Page here

</badtag>

One you get the popup, with chrome or firefox, do a right on an element in this popup
Locate the badtag, do a right click and choose Copy as HTML
Paste it here.
0
 

Author Comment

by:ats2012
Comment Utility
<badtag>




<div class="white-popup-add-asset">

<br><br><br>
<form name="window_add_asset.php" method="post" id="request">

			<b>Asset Information</b>
			<table width="700">
				<tbody><tr>
					<td><b>Asset Tag:</b></td>
					<td><input class="validate[required] searchfield" type="text" name="asset" value=""></td>
					<td><b>Serial Tag:</b></td>
					<td><input class="validate[required] searchfield" type="text" name="serial" value=""></td>
				</tr>
				<tr>
					<td><b>Model:</b></td><td>
					<select name="model" class="validate[required] searchfield">
<option value="" selected=""></option>
<option value="Cisco 871 Router">Cisco 871 Router</option>
<option value="Cisco 881-SEC Router">Cisco 881-SEC Router</option>
<option value="Cisco ASA 5505">Cisco ASA 5505</option>
<option value="Compaq 610">Compaq 610</option>
<option value="Compaq 6730b">Compaq 6730b</option>
<option value="Custom">Custom</option>
<option value="Dell Dimension 4550">Dell Dimension 4550</option>
<option value="Dell Inspiron 600m">Dell Inspiron 600m</option>
<option value="Dell Inspiron 640m">Dell Inspiron 640m</option>
<option value="Dell Inspiron 700m">Dell Inspiron 700m</option>
<option value="Dell Inspiron 710m">Dell Inspiron 710m</option>
<option value="Dell Inspiron N5040">Dell Inspiron N5040</option>
<option value="Dell Latitude 6430u">Dell Latitude 6430u</option>
<option value="Dell Latitude C600">Dell Latitude C600</option>
<option value="Dell Latitude C640">Dell Latitude C640</option>
<option value="Dell Latitude C840">Dell Latitude C840</option>
<option value="Dell Latitude D430">Dell Latitude D430</option>
<option value="Dell Latitude D500">Dell Latitude D500</option>
<option value="Dell Latitude D505">Dell Latitude D505</option>
<option value="Dell Latitude D510">Dell Latitude D510</option>
<option value="Dell Latitude D520">Dell Latitude D520</option>
<option value="Dell Latitude D531">Dell Latitude D531</option>
<option value="Dell Latitude D620">Dell Latitude D620</option>
<option value="Dell Latitude D630">Dell Latitude D630</option>
<option value="Dell Latitude D800">Dell Latitude D800</option>
<option value="Dell Latitude D810">Dell Latitude D810</option>
<option value="Dell Latitude E4300">Dell Latitude E4300</option>
<option value="Dell Latitude E4310">Dell Latitude E4310</option>
<option value="Dell Latitude E5400">Dell Latitude E5400</option>
<option value="Dell Latitude E5500">Dell Latitude E5500</option>
<option value="Dell Latitude E5510">Dell Latitude E5510</option>
<option value="Dell Latitude E5520">Dell Latitude E5520</option>
<option value="Dell Latitude E6220">Dell Latitude E6220</option>
<option value="Dell Latitude E6230">Dell Latitude E6230</option>
<option value="Dell Latitude E6320">Dell Latitude E6320</option>
<option value="Dell Latitude E6330">Dell Latitude E6330</option>
<option value="Dell Latitude E6400">Dell Latitude E6400</option>
<option value="Dell Latitude E6420">Dell Latitude E6420</option>
<option value="Dell Latitude E6520">Dell Latitude E6520</option>
<option value="Dell Mini 9">Dell Mini 9</option>
<option value="Dell Optiplex 380">Dell Optiplex 380</option>
<option value="Dell Optiplex 7010">Dell Optiplex 7010</option>
<option value="Dell Optiplex 745">Dell Optiplex 745</option>
<option value="Dell Optiplex 755">Dell Optiplex 755</option>
<option value="Dell Optiplex 780">Dell Optiplex 780</option>
<option value="Dell Optiplex 790">Dell Optiplex 790</option>
<option value="Dell Optiplex 960">Dell Optiplex 960</option>
<option value="Dell Optiplex GX260">Dell Optiplex GX260</option>
<option value="Dell Optiplex GX270">Dell Optiplex GX270</option>
<option value="Dell Optiplex GX280">Dell Optiplex GX280</option>
<option value="Dell Optiplex GX50">Dell Optiplex GX50</option>
<option value="Dell Optiplex GX520">Dell Optiplex GX520</option>
<option value="Dell Optiplex GX60">Dell Optiplex GX60</option>
<option value="Dell Precision M4600">Dell Precision M4600</option>
<option value="Dell Vostro 200">Dell Vostro 200</option>
<option value="Dell XPS 13">Dell XPS 13</option>
<option value="Dell XPS 14Z">Dell XPS 14Z</option>
<option value="Dell XPS 8500">Dell XPS 8500</option>
<option value="HP Compaq 6730b">HP Compaq 6730b</option>
<option value="IBM System x3550">IBM System x3550</option>
<option value="IBM System x3650">IBM System x3650</option>
<option value="iPad">iPad</option>
<option value="IPad 2">IPad 2</option>
<option value="IPad Mini">IPad Mini</option>
<option value="Latitude D505">Latitude D505</option>
<option value="Latitude E6440">Latitude E6440</option>
<option value="MacBook Pro">MacBook Pro</option>
<option value="PowerEdge 2850">PowerEdge 2850</option>
<option value="PowerEdge SC1425">PowerEdge SC1425</option>
<option value="Projector">Projector</option>
<option value="Surface Pro">Surface Pro</option>
<option value="Thin Client">Thin Client</option>
<option value="Thinkpad T430u">Thinkpad T430u</option>
<option value="VMware Virtual Platform">VMware Virtual Platform</option>
<option value="Wyse Tx0">Wyse Tx0</option>
</select>
                    
                    </td>
					<td><b>Operating System:</b></td><td>
					
                <select name="os" class="validate[required] searchfield">
<option value="" selected=""></option>
<option value="Cisco IOS">Cisco IOS</option>
<option value="iOS">iOS</option>
<option value="Linux">Linux</option>
<option value="Thin Client">Thin Client</option>
<option value="Windows 2000">Windows 2000</option>
<option value="Windows 7">Windows 7</option>
<option value="Windows 8">Windows 8</option>
<option value="Windows Server 2003">Windows Server 2003</option>
<option value="Windows Server 2008">Windows Server 2008</option>
<option value="Windows Server 2012">Windows Server 2012</option>
<option value="Windows XP">Windows XP</option>
<option value="Wyse OS">Wyse OS</option>
</select>           
                </td>  
				</tr>
				<tr>
					<td><b>Date Setup:</b></td>
                                       <td><input class="searchfield" type="text" name="datesetup" value="2014-02-27"></td>
										<td><b>Asigned Too:</b></td>
					<td>inv</td>
				</tr>
			</tbody></table>

            <br>
			            <br>
            <input class="button" type="submit" name="form" value="Add Asset">
            </form>
            			
</div>
<button title="Close (Esc)" type="button" class="mfp-close">×</button></badtag>

Open in new window

0
 
LVL 82

Expert Comment

by:leakim971
Comment Utility
Look for me the same files but different paths :

<script src="js/validate/languages/jquery.validationEngine-en.js" type="text/javascript" charset="utf-8"></script>
<script src="js/validate/jquery.validationEngine.js" type="text/javascript" charset="utf-8"></script>
0
 
LVL 82

Expert Comment

by:leakim971
Comment Utility
ah no, forget my comment
0
 
LVL 82

Expert Comment

by:leakim971
Comment Utility
you said the page close? or it is reloaded?
0
 

Author Comment

by:ats2012
Comment Utility
It just closes and returns back to the main page.
0
 
LVL 82

Expert Comment

by:leakim971
Comment Utility
in the main page add this in the head section :
<script>
jQuery(function($) {
    alert("page loading");
});
</script>

Open in new window


Try again and let me know if you see the alert once the popup is closed
0
 

Author Comment

by:ats2012
Comment Utility
It pops up the page loading box once I click on submit. Window page closes and that pops up.
0
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
Comment Utility
If you get it two times that mean the page is reloading
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

What is a Lightbox? A Lightbox is the effect you see when you click, for example, an image and the screen fades out and up pops the same image but in its full size dimensions. There are lots of Lightbox effects for jQuery. Problem is they are a…
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now