dtqu72830 2019-05-02 09:44
浏览 45

如何在Gravity表单中添加动态内容?

I would like to fill a dynamicly input in my gravity form but i don't get why this is not working. I have 3 "random" input type, which works, but i would like the 4th to be filled automaticaly with a variable in my PHP page. The 4th is "HTML" type in gravity forms with this code :

<li id='field_1_6'  class='gfield gfield_contains_required field_sublabel_below field_description_below gfield_visibility_visible' >
    <label class='gfield_label' for='input_1_6' >Type<span class='gfield_required'>*</span></label>
    <div class='ginput_container ginput_container_text'><input  value="<?php echo get_field("my_variable"); ?>" disabled="disabled" name='input_6' id='input_1_6' type='text'  class='medium' maxlength='30'  tabindex='6'  aria-required="true" aria-invalid="false" /></div>
</li>

The code where the gravity form is called (in a loop for every Custom Post Type) :

echo '<p/><button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModalLong'.$i.'">
                 Postuler
            </button>
            <div class="modal fade" id="exampleModalLong'.$i.'" tabindex="-1" role="dialog" aria-labelledby="exampleModalLongTitle" aria-hidden="true">
                <div class="modal-dialog" role="document">
                    <div class="modal-content">
                        <div class="modal-header">
                            <h5 class="modal-title" id="exampleModalLongTitle">Postuler pour '. get_field("type_demploi") .'</h5>
                            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                <span aria-hidden="true">&times;</span>
                            </button>
                        </div>
                        <div class="modal-body">';
                    gravity_form('Form', false, false, false, '', true);
                    echo ' </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
                        </div>
                    </div>
                </div>
            </div> </div> '; 

Instead of getting an input with my variable content, i'm getting an input with te content '.get_field( I also tried with but its not working too

Do you have any idea ?

Thanks

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 Arduino红外遥控代码有问题
    • ¥15 数值计算离散正交多项式
    • ¥30 数值计算均差系数编程
    • ¥15 redis-full-check比较 两个集群的数据出错
    • ¥15 Matlab编程问题
    • ¥15 训练的多模态特征融合模型准确度很低怎么办
    • ¥15 kylin启动报错log4j类冲突
    • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
    • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序
    • ¥15 onvif+openssl,vs2022编译openssl64