javascript - 在 codeigniter 中,我通过 form_open 提交了一个表单,所有按钮都由我的 form_open ('Home/page' 链接)

标签 javascript php css html codeigniter

<?php echo form_open('Home/OtherDetail'); ?>

<div class="row" style="margin-bottom:5%;" >
    <div class="col col-lg-4 col-md-12 col-sm-12 col-xs-12" style="font-weight: 600; font-size: 100%;">Name:</div>
    <div class="col col-lg-8 col-md-12 col-sm-12 col-xs-12"><input type="text" name="name" style="width:100%" value=""></div> 
    </div>
    
     <div class="row" style="margin-bottom:5%;">
    <div class="col col-lg-4 col-md-12 col-sm-12 col-xs-12" style="font-weight: 600;font-size: 100%;">Father Full Name:</div>
    <div class="col col-lg-8 col-md-12 col-sm-12 col-xs-12"><input type="text" name="FatherName" style="width:100%" value=""></div>
    </div>
    
    <div class="row" style="margin-bottom:5%;">
    <div class="col col-lg-4 col-md-12 col-sm-12 col-xs-12" style="font-weight: 600;font-size: 100%;">Address:</div>
    <div class="col col-lg-8 col-md-12 col-sm-12 col-xs-12"><input type="text" name="Address" style="width:100%" value=""></div>
    </div>
    
<a href="Home/new"><button >add</button></a>
 <a href="Home/new"><button >negative</button></a>
<?php  form_submit('name',value);      ?>
//so all button which are comes in between from open and form close linked with form_open
<?php  form_close(); ?>

//所以所有介于打开和关闭表单之间的按钮都与 form_open 链接

最佳答案

请检查下面的代码,它运行良好。

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>Simple CodeIgniter App - Todos</title>
    <link rel="stylesheet"
    href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
</head>
<body>
    <?php echo form_open('Home/OtherDetail'); ?>
        <div class="row" style="margin-bottom:5%;" >
            <div class="col col-lg-4 col-md-12 col-sm-12 col-xs-12" style="font-weight: 600; font-size: 100%;">Name:</div>
            <div class="col col-lg-8 col-md-12 col-sm-12 col-xs-12"><input type="text" name="name" style="width:100%" value=""></div> 
        </div>

        <div class="row" style="margin-bottom:5%;">
            <div class="col col-lg-4 col-md-12 col-sm-12 col-xs-12" style="font-weight: 600;font-size: 100%;">Father Full Name:</div>
            <div class="col col-lg-8 col-md-12 col-sm-12 col-xs-12"><input type="text" name="FatherName" style="width:100%" value=""></div>
        </div>

        <div class="row" style="margin-bottom:5%;">
            <div class="col col-lg-4 col-md-12 col-sm-12 col-xs-12" style="font-weight: 600;font-size: 100%;">Address:</div>
            <div class="col col-lg-8 col-md-12 col-sm-12 col-xs-12"><input type="text" name="Address" style="width:100%" value=""></div>
        </div>

        <a href="Home/new">
            <?php echo form_button('add','add'); ?>
            <!-- <button type>add</button> -->
        </a>
        <a href="Home/new">
            <?php echo form_button('negative','negative'); ?>
            <!-- <button type>negative</button> -->
        </a>
        <?php echo form_submit('name','btn_name'); ?>//so all button which are comes in between from open and form close linked with form_open
    <?php echo form_close(); ?>
</body>
</html>

关于javascript - 在 codeigniter 中,我通过 form_open 提交了一个表单,所有按钮都由我的 form_open ('Home/page' 链接),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51984148/

相关文章:

php - 如何正确索引以下内容?

php - Traits - 与父类的属性冲突

javascript - 图像而不是单选按钮/文本?

javascript - 在选择值 codeigniter 上显示一个 div

javascript - 单击按钮时如何使输入值变为空白?

javascript - 重定向到用户来自的页面

javascript - 如何强制 jQuery 不自动关闭标签?

javascript - $(document).ready 不要在 IE 中加载

javascript - 在AngularJS中的指令中使用服务函数

javascript - 使用 PHP 将 MySQL 时间以毫秒转换为 javascript 时间戳