私が直面している問題は、調査に一連の質問があることです。最初の質問は、ユーザーがメンバーでない場合はチェックボックスをクリックするようにユーザーに求めます。ユーザーがチェックボックスを選択すると、カーソルは自動的にページの一番下までスクロールし、その後に続くすべての質問をスキップします。
jqueryを使用してさまざまな関数を試しましたが、どれも機能しませんでした。これは私が以前に試したコードです(PSもこの作業をしませんでした)
<?php
if(!stristr($_SERVER['PHP_SELF'],"printSummary")) {
require_once("../lib/include/common.inc.php");
} else {
require_once("../../lib/include/common.inc.php");
}
ob_start();
$node_id = $parentnode?$parentnode:getDataFromSession("data,node_id");
$node_name = get_node_name( $node_id,$_SESSION["survey"],$_SESSION['idLink']);
$surveyForText = getText2("This survey is for:")." ".$node_name;
if(strlen($node_name)>0) {
echo "<script type='text/javascript'>";
echo "$(document).ready(function(){";
echo "$('.generalErrorMsg').first().addClass('generalErrorMsgWithMargin').text(\"$surveyForText\");";
echo "});";
echo "</script>";
}
//code that I am talking about starts here
$currentPageNum = currentPageNumber();
if($currentPageNum==4)
{
echo "<script type=\"text/javascript\">
$(document).ready(function(){
$('input[type=checkbox]').click(function() {
alert('here');
setTimeout(function() {
window.scrollTo(0, 1) },100);
});
//window.scrollBy(100,100); // horizontal and vertical scroll increments
//scrolldelay = setTimeout('pageScroll()',80); // scrolls every 80 milliseconds
});";
echo "</script>";
}
?>
解決コードを手伝ってください。よろしくお願いします-Jathin