0
初学者在这里。我正在处理用户在表单中选择一个选项并单击该按钮的表单。在后台执行一些操作,结果将是一些文本,将显示在表单内。这里是我的代码:问题与表单的CSS
<form name="my_form" id="input" style = "background-color: #e1dddd; padding: 10px; border-radius: 5px;" action="actionpage.php" method="post">
<div class="row" id="output">
<div class="container">
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
<label>Title of the form</label><br><br>
<label>Choose a functionality</label><br>
<select name="message">
<option value="functionality 1">Choose One</option>
<option value="functionality 2">Choose One</option>
</select><br>
<button type="initiate" name="" id="" value="Initiate" class="btn btn-primary btn-lg">Initiate</button>
</div>
</div>
</div>
</div>
</form>
<script type="text/javascript"> //this is to stop the form to go to another page
$(document).ready(function() {
$('#my_form').on('submit', function(e) {
e.preventDefault();
$.ajax({
url : $(this).attr('action') || window.location.pathname,
type: "GET",
data: $(this).serialize(),
success: function (data) {
$("#output").html(data);
},
error: function (jXHR, textStatus, errorThrown) {
alert(errorThrown);
}
});
});
});
</script>
而且actionpage.php有下面的代码:
<?php
//some action happening here.
?>
<form name="my_form2" id="" style = "background-color: #e1dddd; padding: 10px; border-radius: 5px;" action="" method="post">
<div class="row">
<div class="container">
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
<label>Text will appear here.</label><br>
<label>Text will appear here.</label><br>
<label>Text will appear here.</label><br>
</div>
</div>
</div>
</div>
</form>
现在的问题是,将出现在表格内(执行的操作之后)的文本没有坐正确的形式。一些文字从左侧的形式出现。
我很欣赏任何建议,代码示例和指导。
除了内嵌样式外,您还有其他任何CSS吗?请张贴样式。 – ZombieCode 2014-12-19 05:02:32
@僵尸代码我还没有任何CSS,但我不知道我可以使用什么CSS强制文件文本坐在彩色表单中。 – Irfana 2014-12-19 05:18:11
您可以通过检查元素来检查它。 – 2014-12-19 05:20:38