小编Sun*_*aga的帖子

在使用单个表单进行创建和更新时,如何在yii中默认选中复选框

我使用单一表单来创建和更新表单.我需要在下面的表单中默认选中复选框

<div class="row" style='float:left;;margin-left:5px'>
        <?php echo '<span for="label" style="margin-bottom:5px;font-size: 0.9em;font-weight: bold;">Label</span><br />'; ?>
        <?php echo $form->checkBox($model,'label_name',array('value'=>1,'uncheckValue'=>0,'checked'=>'checked','style'=>'margin-top:7px;')); ?>
        <?php echo $form->error($model,'label_name'); ?>
    </div>
Run Code Online (Sandbox Code Playgroud)

我使用上面的代码来实现相同的目的我没有得到预期的结果.在更新表单时,即使未经检查,它也会显示已检查

forms yii

6
推荐指数
1
解决办法
2万
查看次数

如何使用documet.getElementById和getElementsByClassName为display none css属性执行jasmine测试用例

我是茉莉花测试用例的新手我尝试做茉莉花测试用例选择模块后做了这个样式属性变得不确定

 function Selection() {

    }
    Selection.prototype.expandFlightDetails = function() {

        document.getElementsByClassName("flight-details-container").style.display = 'none';
        document.getElementById("expandedFlightDetails").style.display = 'block';
    };
    Selection.prototype.hideFlightDetails = function() {
        document.getElementById("expandedFlightDetails").style.display = 'none';
        document.getElementsByClassName("flight-details-container").style.display = 'block';

    };
Run Code Online (Sandbox Code Playgroud)

我的测试用例是

describe("selection module", function() {
    var selection;

    beforeEach(function () {
        selection= new Selection();

    });
    afterEach(function () {

    });
    it('expand the flight details part ' , function(){
        selection.expandFlightDetails();
        expect(document.body.getElementsByClassName('flight-details-container')[0].style.display).toEqual('none');

    });
    xit('hide the flight details part ', function(){
        selection.hideFlightDetails();
        expect(document.getElementById('expandedFlightDetails').style.display).toEqual('none');

    });
});
Run Code Online (Sandbox Code Playgroud)

执行此操作后,我正在设置并删除代码以便beforEach

TypeError:无法读取未定义的属性"样式"

如果我做错了,请纠正我

javascript css jasmine karma-jasmine

6
推荐指数
1
解决办法
1711
查看次数

我们可以将Meteor框架与mysql数据库一起使用

我找到了很多为Meteor框架引用url的地方,我发现mongodb是数据库,因为我对mongodb知之甚少.那么有没有办法实现mysql而不是mongodb

mysql node.js meteor

4
推荐指数
1
解决办法
7507
查看次数

如何使用正则表达式在特定div和特定锚标记内获取img标记值

我是正则表达式的新手,我尝试了很多用于获取锚标记内的图像标记值html这是我的html表达

<div class="smallSku" id="ctl00_ContentPlaceHolder1_smallImages">
                                <a title="" name="http://www.playg.in/productImages/med/PNC000051_PNC000051.jpg" href="http://www.playg.in/productImages/lrg/PNC000051_PNC000051.jpg" onclick="return showPic(this)" onmouseover="return showPic(this)">
    <img border="0" alt="" src="http://www.playg.in/productImages/thmb/PNC000051_PNC000051.jpg"></a>    <a title="PNC000051_PNC000051_1.jpg" name="http://www.playg.in/productImages/med/PNC000051_PNC000051_1.jpg" href="http://www.playg.in/productImages/lrg/PNC000051_PNC000051_1.jpg" onclick="return showPic(this)" onmouseover="return showPic(this)">
    <img border="0" alt="PNC000051_PNC000051_1.jpg" src="http://www.playg.in/productImages/thmb/PNC000051_PNC000051_1.jpg"></a>
                        </div>
Run Code Online (Sandbox Code Playgroud)

我想只返回图像标签的src值,我尝试了"preg_match_all()"中的匹配模式,模式是

"@<div[\s\S]class="smallSku"[\s\S]id="ctl00_ContentPlaceHolder1_smallImages"\><a title=\"\" name="[\w\W]" href="[\w\W]" onclick=\"[\w\W]" onmouseover="[\w\W]"\><img[\s\S]src="(.*)"[\s\S]></a><\/div>@"
Run Code Online (Sandbox Code Playgroud)

请帮助我尝试了很多时间,这也试过这个链接太匹配图像标签没有嵌套在锚标签使用正则表达式

php regex html-parsing

2
推荐指数
1
解决办法
2551
查看次数

标签 统计

css ×1

forms ×1

html-parsing ×1

jasmine ×1

javascript ×1

karma-jasmine ×1

meteor ×1

mysql ×1

node.js ×1

php ×1

regex ×1

yii ×1