输入框没有出现?

问题描述 投票:0回答:1

我编码adding comments function to RSS articles

在曲折中,它是在PHP编码中显示和输入注释。但是,输入框不会出现。 enter image description here

这是php代码:

$url = "./comments/" . $q.".txt";
//댓글 파일에서 컨텐츠 문자열 가져오기
$txtcomment = file_get_contents($url,true);    
//댓글 나열
echo "<ol>";

if ($q !== "" ) {            
                 $comm = $txtcomment;
                 $arr = [];
                 $arr = explode("--",$comm);
             for ($i=4;$i<count($arr);$i++) {
            echo "<li>".$arr[$i]."</li>";            
       } 
    } else {
    echo "해당기사가 없습니다.";
  }

echo "</ol>";

//중첩검색&결과내 검색 폼 만들기
echo "<br><form class=\"category B\" >
Comment: <input type=\"text\" name=\"comment1\" id=\"comment1\" onkeyup=\"inputComment()\" > 
</form>";

为什么?谢谢你的关心。

php html dom
1个回答
0
投票

由于我使用RSS,我认为php没有正确传递输入标记的属性。我开始改变旧的编码。

换句话说,我认为显示评论和输入评论从一开始就不同了。

getrss.php code起初如下。

echo " <option  id=".$i." onclick=\"showComment".$i."(this.value)\" value=".$item_link4."> Show Comments </option>";

但是,我添加了输入代码

  echo " <option  id=".$i." onclick=\"showComment".$i."(this.value)\" value=".$item_link4."> Show Comments </option>";
  echo "댓글: <input type='text' name='inputComment' size='200' id='input".$i."' onclick='inputComment".$i."(this.value)' >
              <input type='text' name='txtfile' id='txt".$i."' value=".$item_link4." hidden>
              <div id='comment".$i."'><b>information will be listed here.</b></div>";

并且,我将输入框作为下图。 enter image description here

最后,我试图以迂回的方式解决问题。但是,我仍然想知道为什么ajax的ajax不工作!

在我输入我的评论之后,我立即看到了。 enter image description here

进一步编码如下图所示。 enter image description here非常感谢您的分享。

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.