Php JqueryMobile 1.4.0将参数传递到弹出窗口
我对jQuery Mobile和PHP非常陌生,我遇到了一个问题,就是我有一个PHP while循环Php JqueryMobile 1.4.0将参数传递到弹出窗口,php,jquery,jquery-mobile,jquery-mobile-popup,Php,Jquery,Jquery Mobile,Jquery Mobile Popup,我对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'> &l
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
while($row=sasql\u fetch\u数组($idresult)){
回声“
";
}//结束时
回声“”;
}//如果结束,则结束
当用户单击编辑按钮时,我需要传递该特定行的ID。我不确定我应该把这个放在哪里,但可能是这样的。。。?在没有表单的情况下,这会起作用吗
<input type="hidden" name="the_id" value='<?php " . $row ['theid'] . " ?>' />
”/>
描述
描述和编号将包含基于单击链接的相关信息
我一直在研究通过ajax传递数据,但我没有真正了解我应该做什么 我认为这里有两个问题需要您进一步检查:
希望这有帮助可能是重复的谢谢我会仔细看看的!嗨,我已经测试过了,我根本不能让它工作!我正在使用jqm 1.4.1,这会有什么不同吗?不,它不会有任何不同。您需要对其进行一些更改以适应HTML标记,即选择器。创建一个与你的渲染HTML的样本小提琴。你好,好的,谢谢我现在就到那里。。。例如,如果我想传递一个HTML id而不是“LIA”,我可以执行类似$(“theIDofTheLink”)的操作吗{?谢谢你的帮助hi谢谢你的回答。我发现我的原始代码有一些问题,我想我现在已经解决了。你的意思是:另一种方法,可以是通过AJAX将你想要的页面内容动态加载到一个具有弹出数据角色的div。谢谢JQM的弹出功能是针对已经在Dom中的div的,w你能做的就是有一个链接/按钮,一旦按下CallsAnajax请求外部页面,当它完成时,将AJAX响应的内容注入DOM中的一个div中,然后打开JQM弹出窗口。希望这有帮助谢谢我正在研究这个!嗨-我对代码做了一些更改,一直在研究使用AJAX,但我不是I don’我不完全明白如何不用表格就完成这项工作?你能帮忙吗?我已经编辑了我的原始问题。谢谢你给我发一个到目前为止你所拥有的工作版本的链接,我会试着看一看
<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>