我已粘贴了一个独立的HTML代码,有助于理解.我想在更改一个下拉列表时显示隐藏两个输入字段.
我没有错.
任何人都可以告诉我什么是错的,需要修理吗?
$(document).ready(function() {
$('#containerId').find('select[name="Field"]').live('change', function(){
var fieldi = $(this).val();
if(fieldi.length > 1 && fieldi=='4') {
$(this).parent().children('div.formRow' ).find('.FieldName').hide();
$(this).parent().children('div.formRow' ).find('.dropdownName').show();
}
if(fieldi.length > 1 && fieldi=='2') {
$(this).parent().children('div.formRow' ).find('.FieldName').show();
$(this).parent().children('div.formRow' ).find('.dropdownName').hide();
}
});
});Run Code Online (Sandbox Code Playgroud)
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<div id='#containerId'>
<h1>This is a Heading</h1>
<p>This is a paragraph.</p>
<fieldset name="fieldset1" namex="fieldset1" >
<div class="formRow ">
<div class="labelContainer"><label class="rowLabel">label_if<span class="validationMark"></span></label></div>
<div class="rowControl">
<select id="xrule_1" name="Field" class="">
<option value="">Please Select</option>
<option value="2">Field on</option>
<option value="4">Field 2</option>
<option value="3">Field imported on</option>
</select>
</div>
</div> …Run Code Online (Sandbox Code Playgroud)我有id txt1的输入字段,但我无法更改JavaScript的值.
<form action="">
First name: <input type="text" id="txt1" onkeyup="showHint(this.value)">
</form>
<script>
document.getElementById('txt1').value('anyvalue1111');
</script>
Run Code Online (Sandbox Code Playgroud)
注意:我在stackoverflow上找到如何更改输入值但找不到任何答案.问题的标题节省了很多时间.这是一个有效的问题.
我正在尝试使用命令获取mysql dump:
mysqldump -u xxxx -p dbxxx > xxxx270613.sql
Run Code Online (Sandbox Code Playgroud)
用UTF8获取mysqldump的命令是什么?
我试图以这种方式在symfony 3.4中设置日期和时间字段:
$eventProject = new $eventProject();
$eventProject->setDateFrom('2018-05-09');
Run Code Online (Sandbox Code Playgroud)
当我保存值时,它给我的错误如下:
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'dateFrom' can
not be null
In ConversionException.php line 95:
Could not convert PHP value '2018-05-09' of type 'string' to type 'datetime
'. Expected one of the following types: null, DateTime
Run Code Online (Sandbox Code Playgroud)
我无法理解什么是错的?
我正在尝试在 mongodb 中创建一个新角色,但它给了我错误:
> use Admin
switched to db Admin
> db.createRole( { role: "executeFunctions", privileges: [ { resource: { anyResource: true }, actions: [ "anyAction" ] } ], roles: [] } );
2018-03-13T19:59:25.114+0500 E QUERY [thread1] Error: Roles on the 'Admin' database cannot be granted privileges that target other databases or the cluster :
_getErrorWithCode@src/mongo/shell/utils.js:25:13
DB.prototype.createRole@src/mongo/shell/db.js:1541:1
@(shell):1:1
Run Code Online (Sandbox Code Playgroud)