내 HTML 텍스트 영역
의 기본값을 설정하고 싶습니다. 기본값을 추가하려면 <textarea<이것은 기본 텍스트입니다</textarea<
와 같은 작업을 수행해야한다고 자료에서 읽었습니다. 그렇게했지만 작동하지 않습니다. 어떻게 해야 하나요?
[ 자리표시자 속성용] [1] 사용할 수 있는 t , 그러나 기본값입니다 추가하기에서는 doesn& # 39 의 아웃해야 너희는너희가 수 있는 방안을 모색하고 있습니다.
<textarea placeholder="this text will show in the textarea"></textarea>
여기에 체크아웃합니다 -
[! 입력하십시오. 이미지 여기에 설명을] [3]자리표시자 속성용 언약보다는 extarea 의 값을 설정합니다. 대답하도다 ", 자리표시자 속성용 제이보드 파선-짧은 힌트 (단어나 짧은 구입니다) 때 도와주는 사용자에게 데이터 입력 제어 주님으로부터그에게 value". [및 it 숨길지 사용자가 즉시 꽂으십시오 extarea]. 절대로, 기본값입니다 value" " 역할을 합니다. 대한 제어입니다. 스케쳐내 원하는 텍스트 안에 있는 동일팔레트에 합니다,,, 실제 기본 value< < textarea> 슬라이드에서는 /textarea> 따라 여기에 대답을 * 기타
[1]: http://www.w3.org/TR/html5/forms.html # 속성 extarea 자리표시자
데이터베이스의 정보를 텍스트 영역 태그로 가져와 편집하려는 경우: 입력 태그는 여러 줄을 차지하는 데이터를 표시하지 않습니다: 행 작동하지 않음, 태그 입력은 한 줄입니다.
<!--input class="article-input" id="article-input" type="text" rows="5" value="{{article}}" /-->
텍스트 영역 태그에는 값이 없지만 핸들바에서는 정상 작동합니다.
<textarea class="article-input" id="article-input" type="text" rows="9" >{{article}}</textarea>
<textarea ng-model='foo'>Some default value</textarea>
작동하지 .will!
설정해야 할 수 있는 ',' s # 39 기본값입니다 textarea& ng 모델 컨트롤러거 ng init 사용하거나 '각'.
<! - begin 스니핏: js 숨기십시오: 진정한 콘솔: 진정한 바벨. > 거짓값 -;
var myApp = angular.module('myApp',[]);
myApp.controller('MyCtrl', [ '$scope', function($scope){
// your controller implementation here
}]);
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body ng-app='myApp'>
<div ng-controller="MyCtrl">
<textarea ng-init='foo="Some default value"' ng-model='foo'></textarea>
</div>
</body>
</html>
끝 - < 스니핏 >;!
<! - begin 스니핏: js 숨기십시오: 진정한 콘솔: 진정한 바벨. > 거짓값 -;
var myApp = angular.module('myApp',[]);
myApp.controller('MyCtrl', [ '$scope', function($scope){
$scope.foo = 'Some default value';
}]);
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body ng-app='myApp'>
<div ng-controller="MyCtrl">
<textarea ng-model='foo'></textarea>
</div>
</body>
</html>
끝 - < 스니핏 >;!
또한 이 협력했습니다 잘 았겠습니다 가져다줄래요:
<textarea class="form-control" rows="3" name="msg" placeholder="Your message here." onfocus='this.select()'>
<?php if (isset($_POST['encode'])) { echo htmlspecialchars($_POST['msg']);} ?>
</textarea>
이 경우 $ _POST [# 39, & # 39 encode&;] 이 출신이다.
<input class="input_bottom btn btn-default" type="submit" name="encode" value="Encode">
Php 코드 사이에 삽입된 < textarea>; 및 < /textarea>; 것이다.
몇 노트 및 설명.
값 = & # 39, & # 39, '-' a ',' 아니다 '< input> textarea> <, 속성, 즉,', '주기표시 사용할 수 있습니다, # 39, & # 39, <, 입력 유형 = text& >,' 등. # 39, 왜 내가 모르는 don& 만든 것은) 의 방식으로 병합합니다 html5 않기로 that& # 39 는 됐다.
텍스트 영역에 대한 기본값입니다 자리표시자 설정할 수 없습니다. 사용할 수 있습니다.
<textarea rows="10" cols="55" name="description"> /*Enter default value here to display content</textarea>
It 를 사용하는 경우 이 태그 데이터베이스 연결. Php 아닌 다른 언어를 사용할 경우 다른 문법을 사용할 수 있습니다. Php 용:
예:
<textarea rows="10" cols="55" name="description" required><?php echo $description; ?></textarea>
최소화하지만 노력이 필요한 명령을 사용하여 확인란 데 필요한 빈 칸을 php.
티스트리니어스 레비 사용할 수 있습니다.
<! - begin 스니핏: js 숨기십시오: 거짓값 콘솔: 진정한 바벨. > 거짓값 -;
<textarea name="message" rows = "10" cols = "100" onfocus="this.innerHTML=''"> Enter your message here... </textarea>
끝 - < 스니핏 >;!
이 때 기본적으로 이너사믈 의 빈 문자열을 extarea 는 텍스트 영역에 관심이 모아지고 있다.
유념하십시오 extarea 후 렌더링됩니다 변경한 경우 했다. 업데이트된 값을 대신 초기화되었습니다 값을 얻을 수 있습니다.
<!doctype html>
<html lang="en">
<head>
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
<script>
$(function () {
$('#btnShow').click(function () {
alert('text:' + $('#addressFieldName').text() + '\n value:' + $('#addressFieldName').val());
});
});
function updateAddress() {
$('#addressFieldName').val('District: Peshawar \n');
}
</script>
</head>
<body>
<?php
$address = "School: GCMHSS NO.1\nTehsil: ,\nDistrict: Haripur";
?>
<textarea id="addressFieldName" rows="4" cols="40" tabindex="5" ><?php echo $address; ?></textarea>
<?php echo '<script type="text/javascript">updateAddress();</script>'; ?>
<input type="button" id="btnShow" value='show' />
</body>
</html>
텍스트의 가치를 알 수 있듯이 extarea 오프닝곡 및 닫기와 extarea 염려사항 태그를 것과는 다를 것입니다.