问题描述
|
我在foreach中有此代码,其中列出了唯一的代码链接:
<a id=\"<?php echo $id_to ?>\" href=\"<?php echo ADDRESS; ?>messageSent.php?id=<?php echo $id_to ?>\" class=\"charcoal_link\" style=\"line-height: 20px;\" onclick=\"showMessageArea(this); return false;\" >
<?php echo $uniqueCode1?><span class=\"pink_text\"><?php echo $uniqueCode2?></span><?php echo $uniqueCode3?>
</a>
<form id=\"message_area\" style=\"display:none\" method=\"post\" action=\"<?php echo ADDRESS; ?>messageSent.php?id=<?php echo $id_to ?>\">
<textarea name=\"message\" rows=\"10\" cols=\"20\"></textarea>
<input name=\"Submit\" type=\"submit\" value=\"Send\"></input>
</form>
这是我在查看页面源代码时得到的:
<a href=\"http://www-rainbowcode-mobi/messageSent.php?id=36\" class=\"charcoal_link\" style=\"line-height: 20px;\" onclick=\"showMessageArea(this); return false;\" >
KUZELJA<span class=\"pink_text\">000</span>RC
</a>
<form id=\"message_area\" style=\"display:none\" method=\"post\" action=\"http://www-rainbowcode-mobi/messageSent.php?id=36\">
<textarea name=\"message\" rows=\"10\" cols=\"20\"></textarea>
<input name=\"Submit\" type=\"submit\" value=\"Send\"></input>
</form>
<a href=\"http://www-rainbowcode-mobi/messageSent.php?id=38\" class=\"charcoal_link\" style=\"line-height: 20px;\" onclick=\"showMessageArea(this); return false;\" >
ALANZIM<span class=\"pink_text\">000</span>RC
</a>
<form id=\"message_area\" style=\"display:none\" method=\"post\" action=\"http://www-rainbowcode-mobi/messageSent.php?id=38\">
<textarea name=\"message\" rows=\"10\" cols=\"20\"></textarea>
<input name=\"Submit\" type=\"submit\" value=\"Send\"></input>
</form>
问题是当操作触发并且页面转到messageSent并且我再次查看页面源时,“2ѭ”不是我单击的链接的ID。无论我单击哪个链接,它都将使用第一个链接的ID。
这是messageSent页面的来源(我单击了ID为38 NOT 36的链接):
我有一个3英镑,它给出:
Array
(
[id] => 36
[message] => bj,nbgj,[Submit] => Send
)
。
function showMessageArea(link)
{
var message_area = document.getElementById(\'message_area\');
message_area.parentNode.removeChild(message_area);
link.parentNode.insertBefore(message_area,link.nextSibling);
message_area.style.display=\"block\";
}
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)