CodeIgniter Bootstrap form-horizontal in modal in not working - css

My web application uses CodeIgniter framework and Bootstrap 3.0 and I am trying to display a form in my modal. I would like the labels to be on the same line as the input fields but adding form-horizontal to form or modal-body didn't seem to help.
Code segment below:-
<!-- Add Customer Modal -->
<div class="modal fade" id="addCustomer" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="myModalLabel">Add Customer</h4>
</div>
<div class="modal-body">
<?php echo form_open('customer_data/add_customer', ['class'=>'form-horizontal']); ?>
<?php echo form_label('Name: ', 'name'); ?>
<?php echo form_input(['name'=>'name', 'id'=>'name', 'class'=>'form-control']); ?>
<?php echo form_label('Mobile: ', 'mobileNum'); ?>
<?php echo form_input(['name'=>'mobileNum', 'id'=>'mobileNum', 'class'=>'form-control']); ?>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-warning">Add Customer</button>
</div>
<?php echo form_close(); ?>
</div>
</div>
</div>

I think you missed some function
<?php echo form_close(); ?>
or try this:
<!-- Button trigger modal -->
<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#addCustomer">
Launch demo modal
</button>
<!-- Modal -->
<div class="modal fade" id="addCustomer" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="myModalLabel">Modal title</h4>
</div>
<div class="modal-body">
<!--form horizontal-->
<?php echo form_open('customer_data/add_customer', array('class'=>'form-horizontal')); ?>
<?php echo form_label('Name: ', 'name'); ?>
<?php echo form_input(array('name'=>'name', 'id'=>'name', 'class'=>'form-control')); ?>
<?php echo form_label('Mobile: ', 'mobileNum'); ?>
<?php echo form_input(array('name'=>'mobileNum', 'id'=>'mobileNum', 'class'=>'form-control')); ?>
<?php echo form_close();?>
<!--end form-->
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</div>

Related

Contact form 7 special mail tags not working

I have a contact form which is inside a custom post type in a theme template. I want to get current post title when forms sends email to admin. The email works perfectly, but I am not getting post title.
Here is my code:
<?php
$args = array( 'post_type' => 'career_jobs', 'posts_per_page' => -1 );
$the_query = new WP_Query( $args );
?>
<?php if ( $the_query->have_posts() ) : $job_number = 0; ?>
<?php while ( $the_query->have_posts() ) : $the_query->the_post();
$job_number++;
?>
<button type="submit" id="testing" class="btn btn-primary submit-cv-btn" data-toggle="modal" data-target="#jobform" data-whatever="#mdo">Submit CV</button>
<div class="modal fade p-0" id="jobform" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-lg" role="document">
<div class="container pop-up-wrap-body p-1">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title lets-modal-header" id="exampleModalLabel">Submit <span class="sub-heading-lets">CV</span></h1>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true"><img src="<?php echo get_template_directory_uri(); ?>/includes/images/footer/close.png" class="img-fluid"></span>
</button>
</div>
<div class="container">
<div class="row">
<div class="col-12">
<h5 class="lets-modal-sub-header">Start work with us</h5>
</div>
</div>
</div>
<div class="container pop-up-wrap p-0 p-lg-4">
<div class="modal-body">
<?php $form = get_field("add_form_shortcode");
echo do_shortcode("'". $form. "'");
?>
</div>
</div>
<div class="container-fluid pop-up-footer">
<div class="row">
<div class="col-lg-2"></div>
<div class="col-lg-4 col-sm-12 pop-up-footer-text">
<p>1-888-251-1622<br> info#techmatix.nl</p>
</div>
<div class="col-lg-5 col-sm-12 pop-up-footer-text">
<p>Transistorstraat 31, 1322 CK<br> Almere, Netherlands</p>
</div>
<div class="col-lg-1"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php endwhile; wp_reset_postdata(); endif; ?>
I am using [_post_title] special mail tag in mail tab on wordpress.

Show Success Message After form submit in wordpress dashboard

How Show Success Message After form submit in word press dashboard?
This code is used for mail sending in word press dashboard.Mail is successfully sending but i need to show success message after sending a mail
please help..My code is
<div class="modal fade" id="myModal<?php echo $val->id; ?>" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Reply to <?php echo $val->mail; ?></h4>
</div>
<div class="modal-body">
<form method="POST" action="" >
<textarea style=" width: 100%; height: 155px;" name="message_content"></textarea>
<input type="hidden" name="message_id" value="<?php echo $val->id; ?>" >
<input type="hidden" name="mail_to" value="<?php echo $val->mail; ?>" >
</div>
<div class="modal-footer">
<button type="submit" name="send_mail" class="btn btn-default">Send</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</form>
<?php
if(isset($_POST['send_mail'])){
$headers=array('Content-Type: text/html; charset=UTF-8');
$message=$_POST['message_content'];
$id=$_POST['message_id'];
$mail_to=$_POST['mail_to'];
echo "$message";
$message_info = wp_mail($mail_to, "hai", $message, $headers);
}
}
?>
</div>
</div>
</div>
</div>
have you tried like
if($message_info ){
echo 'Email sent successfully';
}
this will display notification if the mail is successfully sent

load iframe before page load

My php page took longer to load, I have a popup on click of some content in that page.
When I click the content the iframe in popup needs to be opened in popup, the popup opens instantly, but the iframe within the popup didn't open till the page finishes loading.
And while that time the popup is visible but blank;
How to open the iframe before loading finishes?
My code is something like this:
<a style="cursor:pointer" <?php
if (isset($_SESSION['u_id']) && $_SESSION['u_id'] > 0) {
?> href="redirect.php; ?>" <?php
} else {
?> href="iframesignin.php?signpopup=<?php
$encd = 'slr' . $fbanr['s_id'];
echo base64_encode($encd);
?>&id=<?php
echo $fbanr['s_id'];
?>&type=slr&mypage=<?php
echo $fullurl;
?>" data-featherlight="iframe" <?php
}
?> target="_blank" >
GO TO STORE</a>
Here the popup appears through data-featherlight="iframe"
use include/require function intead of iframe
<button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal">Open Modal</button>
<!-- Modal -->
<div id="myModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Modal Header</h4>
</div>
<div class="modal-body">
<p>Some text in the modal.</p>
<iframe src="testing1.php" width="200" height="200"></iframe>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
I hope this will help you

Press enter to send message to chat

i got a template site when i bought a package and it has a built in chat function, however you need to press a "send" button each time to send chat messages, this is the script used, i guess it is kinda easy to do it but in not good at scripting :/
<div class="col-lg-4 border-left affix-items scrollbar" id="room-items">
<div id="dropboxy">
<?php
?>
</div>
</div>
<div class="col-lg-6 affix-players" style="padding:10px;">
<div id="playersdropboxy">
<?php include_once("players.php"); ?>
</div>
<div id="affix-players" class="scrollbar">
<div id="rooms"></div> </div> </div> <div class="col-lg-5 affix-right">
<div class="col-xs-24 chat"> <div class="row chat-container">
<div class="row chat-buttons"> <div class="col-xs-24"> <div class="media-body"> <div class="input-group">
<input type="text" class="form-control chat-message" id="text-massage" style="margin-left:6px;" maxlength="300"> <span class="input-group-btn">
<?php if(isset($_SESSION['steamid'])) { ?>
<button class="btn btn-primary" type="submit" data-loading-text="<i class='fa fa-spinner fa-spin'></i> WAIT..." id="send_massage" style="margin-right:6px;">SEND</button>
<div class="sml-bnt" id="smile"></div>
<? }
else { ?>
<form method="get" action="index.php"><input type="hidden" name="login" value=""/><input type="submit" class="btn btn-primary" value="Log in to chat" style="margin-right:6px;"/></form>
<?php }
?>
</span> </div> </div> </div> </div>
<div class="col-xs-24 messages messages-img" style="width:250px;">
<?php if(isadmin($_SESSION['steamid'])){
echo'Admin tools: [clear chat], [turn '. (chaton() ? 'off' : 'on').']';
} ?>
<? include ('mini-chat.php'); ?>
</div> </div>
</div>
<div id="raffle"><div class="col-xs-24 raffle"> <div class="cont"> <div class="circle"> <img id="raffle-img"> </div> <h4 class="name" id="raffle-name"></h4>
<h4 id="countdown-raffle-timer" data-countdown="2020-08-08"></h4>
<a class="btn btn-default" href="?login">LOG IN</a> </div> </div> </div> </div> </div>
Try change method="get" to method="post"

Modal not showing up correctly in asp.net mvc

I am trying to accomplish a cool modal that slides down onto the page. I ran into a problem and do not know what it could be, but when I click the button the modal isn't being loaded at all even though the #CmapModal shows up in the url. Any idea as to why the modal is not displaying when I click it?
Code for modal:
<p><a data-toggle="modal" href="#CmapModal" class="btn btn-default"><b>View Map »</b></a></p>
</div>
<!-- Modal -->
<div class="modal fade" id="CmapModal" tabindex="-1" role="dialog" aria-labelledby="CmapModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title">Modal title</h4>
</div>
<div class="modal-body">
...
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary">Save changes</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
Not sure why you want to do this with only CSS and HTML.
Here is a working solution for you: http://jsfiddle.net/H4SDk/
I have added a short javascript code:
$( "#clickme" ).click(function() {
$( "#book" ).toggle("slow");
});
You can change the ID names yourself.
If I understood correct you just wanted the modal to show, right?
You have missed the class "hide" in your model div. Try this;
<div class="modal hide fade" id="CmapModal" tabindex="-1" role="dialog" aria-labelledby="CmapModalLabel" aria-hidden="true">
JSFiddle Example

Resources