我有這樣的代碼:JS不執行
if ($has_freechat1 && $has_freechat2)
{
if (($has_freechat1['confirmed'] == 1) && ($has_freechat2['confirmed'] == 1))
{
$was_clicked = 0;
?>
<a href="freechatcontacts.php?id=<?php echo $id_to.$was_clicked; ?>" class="charcoal_link" style="line-height: 20px;" name="message" id="message" onClick="return send('<?php echo $was_clicked;?> return false;')">
<?php echo $uniqueCode1?><span class="pink_text"><?php echo $uniqueCode2?></span><?php echo $uniqueCode3?>
</a>
<?php
if ($was_clicked == 1)
{
?>
<tr>
<td><input name="password" type="textarea" rows="10" cols="20" value="<?php echo $aCleanPost['message']['value']?>" /></td>
</tr>
<tr>
<td><br /><input name="cmdSubmit" type="submit" value="Send" /><br/> </td>
</tr>
<?php
}
}
上述顯示器一個uniquecode鏈路,當我點擊它,我想的HTML文本區域以顯示,以便用戶可以輸入一個短message..the onlcick發送()是一個JS函數,但它不執行它,所以我可以設置$ was_clicked爲1
我該如何解決這個問題? 請幫 感謝你的意見
編輯 sendMessage
功能:
<script type="text/JavaScript">
function send(val)
{
val = 1; //was clicked
return val;
}
</script>
這是您使用到瀏覽器的瀏覽器。 – Sreekumar 2011-05-27 11:41:05
你可以發佈sendMessage函數定義嗎? – Xaerxess 2011-05-27 11:42:06
我現在和在這裏使用的鉻是PHP的sendMessage: 函數SendMessage() { >
<輸入名稱= 「cmdSubmit」 類型= 「提交」 值= 「發送」 />