Im trying to When I click in my "create posts" link I want to show the form that I have in my "post-create.php" in a fancybox but Im not having sucess with this. It is possible?
I have a menu.php file with a link for other pages:
<li><span>Manage Posts</span>
<ul>
<li><a href="dashboard.php?ac=posts/posts-create" class="fancybox">Create Post</a></li>
<li><a href="dashboard.php?ac=posts/posts"> Edit Post</a></li>
</ul>
</li>
Then I have a post-create.php file with a form:
<form name="form" action="" method="post" enctype="multipart/form-data">
<label class="line">
<span class="data">Image:</span>
<input type="file" class="fileinput" name="thumb" size="60" style="cursor:pointer; background:#FFF;" />
</label>
<label class="line">
<span class="data">Title:</span>
<input type="text" id="title" name="title" value="<?php if(isset($_POST['title'])) echo $f['title']; ?>" />
</label>
<label class="line">
<span class="data">Content:</span>
<textarea name="content" class="editor" rows="15"><?php if(isset($_POST['content'])) echo htmlspecialchars($f['content']); ?></textarea>
</label>
</form>
Then is my fancybox script:
$(document).ready(function() {
$("fancybox").fancybox({
maxWidth : 800,
fitToView : false,
width : '70%',
height : '70%',
autoSize : false,
closeClick : false,
openEffect : 'elastic',
closeEffect : 'elastic',
iframe: {
preload: false
}
});
})