2012-04-21 25 views
-1

你能告訴我爲什麼用這種形式:textarea的回報.VAL()只如果超過15個字符

<div id="comment-form"> 
<h3>Commenta questo racconto:</h3> 
<form method="post" id="story-comment-form" action="#"> 
    <textarea name="comment" id="story-comment-text"></textarea> 
    <input type="submit" name="vote" class="submit" id="story-comment-submit" title="Invia commento" value="Invia commento"/> 
<form> 
</div> 

這jQuery代碼:

$("#story-comment-submit").click(function(e) 
{ 
    e.preventDefault(); 
    var a = $("#story-comment-text").val(); 
    alert(a); 
}); 

VAR一個只返回一個值textarea中有15個以上的字符?

+2

http://jsfiddle.net/malet/St2FX/ - 它似乎工作正常,你有任何其他位可能會干擾的代碼? – Mikey 2012-04-21 16:56:21

+0

[Negative](http://jsfiddle.net/JmPUS/) – noob 2012-04-21 16:57:14

+0

http://jsfiddle.net/SE2Nq/在IE,Chrome,Firefox中試用過。使用少於15個字符。 – 2012-04-21 17:01:28

回答

0

解決了它,我有另一個腳本的問題。對不起大家。

相關問題