作者iloveyouai94 (夏天好熱)
看板Ajax
標題[問題] 為什麼一點反應都沒有...
時間Fri Aug 20 11:07:50 2010
function Yes()
{
var a=form2.govenId.value;
var b=form2.CgovenId.value;
if (a.equals(b)){
alert("==");
}
else
alert("xx");
以上是我的javascript裡的內容
我想要抓取我的input裡的資料做比對 兩個名字分別是 govenId跟CgovenId
不知道為什麼 我一進到這個function怎樣就是沒反應
不管是把它換成
function Yes()
{
if (document.form2.govenId.value.equals(document.form2.CgovenId.value) )
{
alert("==");
}
else
alert("xx");
}
這樣也沒反應!!
是按下去什麼反應都沒有(寫在button裡用onclick的方式進來的)
麻煩各位高手幫我解答
感激> <
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.128.153.200
1F:推 No:equals沒定義? 08/20 11:15
2F:→ sk1765:equals 為自行定義的phototype 可能要了解是否有定意 08/28 13:29
3F:→ sk1765:一般欄位內容為字串 用==號比較就好啦 08/28 13:29
4F:→ sk1765:form2 可能要寫成document.forms[x].elements[y].value 08/28 13:33
5F:→ sk1765:瀏覽器不是沒反應 只是你沒有看到錯誤訊息 換firefox看看 08/28 13:35
6F:→ sk1765:錯誤主控台裡一定有寫 08/28 13:35