我是jQuery Mobile和PHP的新手,我遇到的问题是我有一个PHP while循环
while ( $row = sasql_fetch_array ( $idresult ) ) {
echo "
<li>
<a href='#' data-rel='popup' data-position-to='window' data-transition='pop'>
<div class='ui-grid-a'>
<div class='ui-block-a'>
<div class='ui-bar ui-bar-a titleRow' style='height:15px'>Identification Type</div>
<div id='idType' class='ui-bar ui-bar-a 'style='height:15px; background-color:transparent; border: none; color: black; font-weight: normal;' >" . $row ['description'] . "</div>
</div>
<div class='ui-block-b'>
<div class='ui-bar ui-bar-a titleRow' style='height:15px'>Details</div>
<div id='idNo' class='ui-bar ui-bar-a ' style='height:15px; background-color:transparent; border: none; color: black; font-weight: normal;'>" . $row ['number'] . "</div>
</div>
</div>
</a>
<a href='#editCustId' data-rel='popup' data-position-to='window' data-transition='pop'>Edit</a>
</li>
";
} // end while
echo "</ul>";
} // end if
当使用点击编辑按钮时,我需要传递该特定行的ID。我不知道我应该把它放在哪里,但它可能是这样的......?当没有形式时,这会起作用吗?
<input type="hidden" name="the_id" value='<?php " . $row ['theid'] . " ?>' />
然而,我无法弄清楚如何做到这一点。我尝试将对话框打开为新页面,即
<a href='./editCustId.php?id=" . $row['theid'] . "' data-rel='popup' data-position-to='window' data-transition='pop' class='ui-btn ui-btn-inline ui-icon-edit ui-btn-icon-notext'>Edit</a>
单击编辑时,此弹出窗口将打开
<div data-role='popup' id='editCustId' data-theme='a' data-overlay-theme='a' data-dismissible='false' style='min-width: 300px;'>
<div data-role='header' data-theme='a'>
<h1>Add ID</h1>
</div>
<div data-role='main' class='ui-content'>
<form id='editId' onsubmit="return false;">
<input type="hidden" name="cust_id" value='<?php echo $custid; ?>' />
<input type="hidden" name="sess_id" value='<?php echo $sid; ?>' />
<!-- <input type="hidden" name="submitted" value="true" /> -->
<div class="ui-field-contain">
<label for="phoneType">Type</label>
<select name="idType" id="idType">
<?php echo $idInnerOptions; ?>
</select>
</div>
<div class="ui-field-contain">
<label for="idDesc">Description</label> <input type="text" name="idDesc" id="idDesc" value="">
</div>
<div class='ui-grid-a'>
<div class='ui-block-a'>
<input type='submit' id="submit" value='Update' class='ui-btn ui-btn-inline' data-transition='pop' />
</div>
<div class='ui-block-b'>
<a href='#' class='ui-btn' data-rel='back' data-transition='pop' id="addIdReset">Cancel</a>
</div>
<div id="success" style="color: black;"></div>
</div>
</form>
</div>
</div>
说明和编号将包含基于点击链接的相关信息。
我一直在研究通过ajax传递数据,但我真的没有得到我应该做的事情?
答案 0 :(得分:0)
我认为这里有2个问题需要您查看更多信息:
希望这有帮助