[英]Cycle through different DIVs using Next and previous buttons
This script just cycle through a couple divs. 该脚本仅循环几个div。
But you can use the "c" variable to set a value of an hidden form input. 但是您可以使用“ c”变量来设置隐藏表单输入的值。
Put your form under the end of <div class="innerContent">
将表格放在
<div class="innerContent">
<form action='YourTargetPage.php' method='post'>
<input type='hidden' value='3' id='selectedDiv'>
<input type='submit' value='submit'>
</form>
And add this to the loadContent() jQuery script: 并将其添加到loadContent()jQuery脚本中:
$('#selectedDiv').val(c);
You will then have a $_POST['selectedDiv'] containing the 'c' value in yourTargetPage.php. 然后,在yourTargetPage.php中将有一个$ _POST ['selectedDiv']包含'c'值。
The c variable is zero based since it's the index of an array... So 0=project 1, 1=Project 2, ect. c变量基于零,因为它是数组的索引。所以0 = project 1,1 = Project 2,依此类推。
The default (onload) value of the hidden input should be the same as the default value of the script var c = 3;
隐藏输入的默认(加载)值应与脚本的默认值
var c = 3;
in case the user select the first project without triggering the loadContent() function. 如果用户选择第一个项目而不触发loadContent()函数。
;) ;)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.