Jump to content

unihtmlFrame post refresh


mehmet07

Recommended Posts

Note: Solved...

hi,

i add unihtmlframe on form. and i add this code unihtmlframe html  properties. 

i run project. and click submit button in uniHtmlFrame.  project to reopened.

thanks. 

 

my Veri.php Code:

<?php
 echo "aa";
?>

 

 

my HTML CODE:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Submit PHP Forms without Page Refresh using jQuery and Ajax</title>
<script type="text/javascript" src="jquery-1.11.3-jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function()
{ 
$(document).on('submit', '#reg-form', function()
{  
var data = $(this).serialize();

$.ajax({
type : 'POST',
url  : 'http://localhost/ajax/veri.php',
data : data,
success :  function(data)
  { 
$("#reg-form").fadeOut(500).hide(function()
{
$(".result").fadeIn(500).show(function()
{
$(".result").html(data);

});
});


  }
});
return false;
});
});
</script>
<style type="text/css">
*{margin:0;padding:0;}
#container
{
margin:50px auto;
padding:15px;
border:solid #cdcdcd 1px;
width:500px;
height:320px;
background:#f9f9f9;
}
table,td
{
width:100%;
border-collapse:collapse;
padding:10px;
}
input
{
width:100%;
height:35px;
text-align:center;
border:solid #cddcdc 2px;
font-family:Verdana, Geneva, sans-serif;
border-radius:3px;
}
button
{
text-align:center;
width:50%;
height:35px;
border:0;
font-family:Verdana, Geneva, sans-serif;
border-radius:3px;
background:#00a2d1;
color:#fff;
font-weight:bolder;
font-size:18px;
}
hr
{
border:solid #cecece 1px;
}
#header
{
width:100%;
height:50px;
background:#00a2d1;
text-align:center;
}
#header label
{
font-family:Verdana, Geneva, sans-serif;
font-size:35px;
color:#f9f9f9;
}
a{
color:#00a2d1;
text-decoration:none;
}
</style>
</head>


<body>


<div id="header">
<label>cleartuts - Programming Blog</label>
</div>
<br /><br />
<div id="container">
<div id="form" class="result">
     <form method="post" id="reg-form">
        <table border="0">
        <tr>
        <td><input type="text" name="fname" id="lname" placeholder="First Name" /></td>
        </tr>
        
        <tr>
        <td><input type="text" name="lname" id="lname" placeholder="Last Name" /></td>
        </tr>
        
        <tr>
        <td><input type="text" name="email" id="email" placeholder="Your Mail" /></td>
        </tr>
        
        <tr>
        <td><input type="text" name="phno" id="phno" placeholder="Contact No" /></td>
        </tr>
        
        <tr>
        <td><hr /></td>
        </tr>
        
        <tr>
        <td align="center"><button type="submit">Register</button></td>
        </tr>
        </table>
        </form>
    </div>
</div>


</body>


</html>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...