Search Results page destroys background - javascript

Here is the original site. usahvacsupply.com Once you search an item, the search results take over the whole page and kill the background. I'm not sure how to control the overflow. The part of the site where the overflow goes haywire is http://www.usahvacsupply.com/servlet/Categories. I'll post more code if needed. The code on the bottom corresponds with the http://www.usahvacsupply.com/servlet/Categories page. any help would be appreciated.
<table id="body" width="960" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td width="100%">
<script type="text/javascript">
if (!createBookmark) {
var createBookmark = function() {
if (window.sidebar) // Mozilla Firefox Bookmark
window.sidebar.addPanel(document.title, location.href, '');
else if (window.external) // IE Favorite
window.external.AddFavorite(location.href, document.title);
else // all others
alert("Please press CTRL+D to bookmark this page.");
};
}
</script>
<table id="layout" class="panel-layout" width="100%" cellspacing="0" cellpadding="0" border="0" rules="none">
<tbody>
<tr>
<td id="p1" valign="top">
<script type="text/javascript">
var ProStores;
if (!ProStores)
ProStores = {};
ProStores.PageLink = function(link) {
var strParams = 's=' + link.getAttribute('page');
var strThis = location.href;
if (strThis.indexOf('?') > -1) {
if (strThis.search(/s=[0-9]+/) > -1)
link.href = strThis.replace(/s=[0-9]+/, strParams);
else
link.href = strThis + '&' + strParams;
}
else
link.href = strThis + '?' + strParams;
};
</script>
<link href="/servlet/0-3-30d-727500-com.prostores.panel.List%7Estyle.css/Asset" title="style" type="text/css" rel="stylesheet">
<style type="text/css">
<table id="cataloglist.31" class="list-boundary" width="100%" cellspacing="0" cellpadding="0" border="0" rules="none">
<tbody>
<tr>
<td>
<table width="100%" cellspacing="0" cellpadding="0" border="0" align="center" rules="none">
<tbody>
<tr>
<td valign="top" align="left" colspan="1">
<h1 align="left">Search Results</h1>
<div class="" align="left" style="padding:2px">
<p>
Found
<b>1000</b>
product(s) for
<b>All</b>
(1-25 of 1000)
</p>
</div>
</td>
</tr>
<tr>
<td valign="middle" colspan="1">
<div class="product-list-container">
<div class="top">
<div class="right">
<div class="left"></div>
</div>
</div>
<div class="titlebar group-title">
<b> Breakers | Bryant Carrier Payne Day&Night </b>
</div>
<div class="panel-content">
<center>
<table class="" width="100%" cellspacing="2" cellpadding="0" border="0">
<tbody>
<tr>
<td colspan="1" style="height:1px"></td>
</tr>
<tr>
<td class="item-cell" width="100%" valign="bottom" height="100%" style="padding:8px">
<table width="100%" height="100%" cellspacing="0" cellpadding="0" border="0" rules="none">
</td>
</tr>
<tr>
</tbody>
</table>
</center>
</div>
<div class="bottom">
</div>
</td>
</tr>
<tr>
<tr>
<tr>
<tr>
<tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</body>
</html>

I can see that your problem isn't occuring anymore, but when you search for a product that doesn't exist. Your div.footerBorder gets floated over the background to the left. Fix that by applying:
margin-left: 10px;
To your
/servlet/0-0-30d-13e0e1158d0-legacycss/Asset
Inside your ".footerBorder" on row 240, replace the whole rule to:
.footerBorder {
width: 960px;
min-height: 160px;
background: url("/images/store_version1/footer.gif") no-repeat;
margin-left: 10px;
}
Edit:
If that conflicts on other pages, let me know and I'll help you with it. Cheers!

Related

The value of variable is not showing while sending email using phpmailer

link for image i have written a code which sends invoice details via email after completing the order. but the issue is that when i am running this code in a file.php it is working fine and giving me all the value of variable and executing the while loop
But while mailing, the while() function is not getting execueted and the invoice details are appearing null in the email.
The mail consist of details of the shopping which the user had done.
function sentInvoice($conn,$oid)
{
$url="http://localhost/user/contactus.php";
$date=date('Y');
$nego=0;
$res=mysqli_query($conn,"select order_details.*,product.id,product.pname,orders.total_price from order_details inner join product on product.id=order_details.product_id inner join orders on orders.id=order_details.order_id where order_details.order_id='$oid'");
$row=mysqli_fetch_assoc(mysqli_query($conn,"select orders.*, ecom_users.id,ecom_users.fname,ecom_users.email from orders inner join ecom_users on ecom_users.id=orders.uid where orders.id='$oid'"));
$total=0;
$dateArr=explode(" ",$row['added_on']);
$order_date=$dateArr[0];
$html='<body>
<span class="preheader">This is an invoice for your purchase on '.$order_date.'.</span>
<table class="email-wrapper" width="100%" cellpadding="0" cellspacing="0" role="presentation">
<tr>
<td align="center">
<table class="email-content" width="100%" cellpadding="0" cellspacing="0" role="presentation">
<!-- Email Body -->
<tr>
<td class="email-body" width="100%" cellpadding="0" cellspacing="0">
<table class="email-body_inner" align="center" width="570" cellpadding="0" cellspacing="0" role="presentation">
<!-- Body content -->
<tr>
<td class="content-cell">
<div class="f-fallback">
<h1>Hi '.$row['fname'].',</h1>
<p>Thanks for using Our Website ShopHana. This is an invoice for your recent purchase.</p>
<table class="attributes" width="100%" cellpadding="0" cellspacing="0" role="presentation">
<tr>
<td class="attributes_content">
<table width="100%" cellpadding="0" cellspacing="0" role="presentation">
<tr>
<td class="attributes_item">
<span class="f-fallback">
<strong>Amount:'.$row['total_price'].'</strong>
</span>
</td>
</tr>
<tr>
<td class="attributes_item">
</span>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- Action -->
<table class="purchase" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td>
<h3>'.$oid.'</h3>
</td>
<td>
<h3 class="align-right">'.$order_date.'</h3>
</td>
</tr>
<tr>
<td colspan="2">
<table class="purchase_content" width="100%" cellpadding="0" cellspacing="0">
<tr>
<th class="purchase_heading" align="left">
<p class="f-fallback">Description</p>
</th>
<th class="purchase_heading" align="right">
<p class="f-fallback">Amount</p>
</th>
</tr>';
while($rem=mysqli_fetch_assoc($res))
{
$pid=$rem['product_id'];
$user_id=$row['uid'];
$a_query=mysqli_fetch_assoc(mysqli_query($conn,"select negotiate from addtocart where pid=$pid and uid=$user_id"));
$nego=$a_query['negotiate'];
echo $nego;
if($nego!=0)
{
$total=$total+$nego;
}
else
{
$total=$total+$rem['price'];
}
//this part is not showing up in the email
$html.='
<tr>
<td width="80%" class="purchase_item"><span class="f-fallback">'.$rem['pname'].'</span></td>
<td class="align-right" width="20%" class="purchase_item"><span class="f-fallback">'.$rem['price'].'</span></td>
</tr>';
}
$html.='<tr>
<td width="80%" class="purchase_footer" valign="middle">
<p class="f-fallback purchase_total purchase_total--label">Total</p>
</td>
<td width="20%" class="purchase_footer" valign="middle">
<p class="f-fallback purchase_total">'.$total.'</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
<p>If you have any questions about this invoice, simply reply to this email or reach out to our support team for help.</p>
<p>Cheers,
<br>The ShopHana Team</p>
<!-- Sub copy -->
</div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table class="email-footer" align="center" width="570" cellpadding="0" cellspacing="0" role="presentation">
<tr>
<td class="content-cell" align="center">
<p class="f-fallback sub align-center">©'.$date.' ShopHana All rights reserved.</p>
<p class="f-fallback sub align-center">
[SHOPHANA, LLC]
<br>1234 Street Rd.
<br>Suite 1234
</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>';
include('smtp/PHPMailerAutoload.php');
$mail=new PHPMailer(true);
$mail->isSMTP();
$mail->Host="smtp.gmail.com";
$mail->Port=587;
$mail->SMTPSecure="tls";
$mail->SMTPAuth=true;
$mail->Username="somemail9245#gmail.com";
$mail->Password="passwords";
$mail->SetFrom("shophana2337#gmail.com");
$mail->addAddress($row['email']);
$mail->IsHTML(true);
$mail->Subject="Invoice Details";
$mail->Body=$html;
$mail->SMTPOptions=array('ssl'=>array(
'verify_peer'=>false,
'verify_peer_name'=>false,
'allow_self_signed'=>false
));
if($mail->send()){
return true;
}else{
return false;
}
}

Remove spaces between two inner ```<td>``` elements

var str1 = "78896541230";
str1 = str1.replace(/.(?=.{4})/g, 'x');
document.getElementById('output').innerHTML = str1;
<table cellspacing="0" cellpadding="0" border="0" id="maintable" class="maintable">
<tr>
<td valign="top">
<table cellspacing="0" cellpadding="0" border="0" width="100%" align="center" id="PageHeadingTable">
<tr>
<td id="PageHeading" nowrap="true">OTP Verification</td>
<td id="PageHeadingDate">
<xsl:value-of select="//faml/request/datetime" />
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="100%" valign="top">
<div class="y_scroll" id="contentarea" style="width:98%;position:absolute">
<!--y_scroll start-->
<div class="contentarea">
<!--contentarea start-->
<span id="box" class="box"> <!--rounded curve/border start-->
<div class="toppanel"><ul><li></li></ul></div>
<div class="middlepanel">
<table border="0" cellspacing="0" cellpadding="1" class="formtable">
<caption>Confirm your identity</caption>
<tr> <td>A One Time Password(OTP) has been sent to your mobile phone with number ending in </td><td id="output"></td>
</tr>
<tr ><td > If this is not your mobile number, you are advised to end your internet banking and call us</td>
</tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr></tr>
</div>
</table>
</div>
<div class="bottompanel"><ul><li></li></ul></div>
</span>
</div>
<!--contentarea end-->
</div>
</td>
</tr>
</table>
I am trying to make an OTP page where user can input the recieved OTP on the screen.Since I have masked the user's phone number for security reasons. I am getting the value of masked phone number in seperate <td>. The only problem is there is a space between my two <td>. I am not sure how to remove the space since its nested. I have added the code in the snippet for better understanding of my problem.
Any help or suggestion will be appreciated.Thanks!!

Input button onclick do not work in JSP

I test my issue in Firefox. I click the save button(it is a input, and the type is button), it ought to execute:
onclick="checkchar()"
but it did not.
My part of code in jsp:
<script language="javascript">
function checkchar(){
/*
if(document.Form2.stationRun.value.length>2500){
alert("站点运行情况字数不能超过2500字");
return;
}
if(document.Form2.devRun.value.length>2500){
alert("设备运行情况字数不能超过2500字");
return;
}
*/
//alert('before...');
document.Form2.action="${pageContext.request.contextPath}/system/elecCommonMsgAction_save.do";
document.Form2.submit();
alert(" 待办事宜保存成功!");
}
...
<input type="button" name="BT_Submit" value="保存" onclick="checkchar()" id="BT_Submit" style="font-size:12px; color:black; height:20px;width:50px">
I don't know why I click my save button, the method did not execute, some one can help me with this? and if is caused by the upload stylesheet (http://localhost:8080/css/Font.css)? I am not sure.
EDIT
Because the main framework is frameset, and the javascript methods and the input button is in my main page(you can see the below, which is in red rectangle I add). So use firebug it shows there do not contains any javascript code.
EDIT -2
The all code of my actingIndex.jsp:
<%# page language="java" pageEncoding="UTF-8"%>
<%--引入struts tags--%>
<%# taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title>运行监控模块编辑</title>
<link href="${pageContext.request.contextPath }/css/Style.css" type="text/css" rel="stylesheet">
<link href="${pageContext.request.contextPath }/css/showText.css" type="text/css" rel="stylesheet">
<script language="javascript" src="${pageContext.request.contextPath }/script/function.js"></script>
<script language="javascript" src="${pageContext.request.contextPath }/script/limitedTextarea.js"></script>
<script language="javascript" src="${pageContext.request.contextPath }/script/showText.js"></script>
<script src="${pageContext.request.contextPath}/ckeditor/ckeditor.js"/>
<script src="${pageContext.request.contextPath}/ckfinder/ckfinder.js"/>
<script type="text/javascript">
function checkchar(){
/*
if(document.Form2.stationRun.value.length>2500){
alert("站点运行情况字数不能超过2500字");
return;
}
if(document.Form2.devRun.value.length>2500){
alert("设备运行情况字数不能超过2500字");
return;
}
*/
alert('before...');
document.Form2.action="${pageContext.request.contextPath}/system/elecCommonMsgAction_save.do";
document.Form2.submit();
alert(" 待办事宜保存成功!");
}
function addEnter(element){
document.getElementById(element).value = document.getElementById(element).value+"<br>";
}
function checkTextAreaLen(){
var stationRun = new Bs_LimitedTextarea('stationRun', 2500);
stationRun.infolineCssStyle = "font-family:arial; font-size:11px; color:gray;";
stationRun.draw();
var devRun = new Bs_LimitedTextarea('devRun', 2500);
devRun.infolineCssStyle = "font-family:arial; font-size:11px; color:gray;";
devRun.draw();
}
window.onload=function(){
//checkTextAreaLen();
}
</script>
</head>
<body>
<form name="Form1" id="Form1" method="post">
<table cellSpacing="1" cellPadding="0" width="90%" align="center" bgColor="#f5fafe" border="0">
<tbody>
<tr height=10><td></td></tr>
<tr>
<td>
<TABLE style="WIDTH: 105px; HEIGHT: 20px" border="0">
<TR>
<TD align="center" background="${pageContext.request.contextPath }/images/cotNavGround.gif"><img src="${pageContext.request.contextPath }/images/yin.gif" width="15"></TD>
<TD class="DropShadow" background="${pageContext.request.contextPath }/images/cotNavGround.gif">运行监控列表</TD>
</TR>
</TABLE>
</td>
</tr>
<tr>
<td class="ta_01" align="center" bgColor="#f5fafe" colspan=3>
<table cellspacing="0" cellpadding="1" rules="all" bordercolor="gray" border="1" id="DataGrid1"
style="BORDER-RIGHT:gray 1px solid; BORDER-TOP:gray 1px solid; BORDER-LEFT:gray 1px solid; WIDTH:100%; WORD-BREAK:break-all; BORDER-BOTTOM:gray 1px solid; BORDER-COLLAPSE:collapse; BACKGROUND-COLOR:#f5fafe; WORD-WRAP:break-word">
<tr style="FONT-WEIGHT:bold;FONT-SIZE:12pt;HEIGHT:25px;BACKGROUND-COLOR:#afd1f3">
<td align="center" width="40%" height=22 background="${pageContext.request.contextPath }/images/tablehead.jpg">站点运行情况</td>
<td align="center" width="40%" height=22 background="${pageContext.request.contextPath }/images/tablehead.jpg">设备运行情况</td>
<td align="center" width="20%" height=22 background="${pageContext.request.contextPath }/images/tablehead.jpg">创建日期</td>
</tr>
<div id="showInfomation" style="visibility: hidden"></div>
<tr onmouseover="this.style.backgroundColor = 'white'" onmouseout="this.style.backgroundColor = '#F5FAFE';">
<td style="HEIGHT:22px" align="center" width="40%">
<div class="scrollStyle" align="left" onmouseover="showInfoWithPanel(this)" onmouseout="hiddenInfoPanel(this)" style="table-layout:fixed;">
<s:property value="stationRun"/>
</div>
</td>
<td style="HEIGHT:22px" align="center" width="40%">
<div class="scrollStyle" align="left" onmouseover="showInfoWithPanel(this)" onmouseout="hiddenInfoPanel(this)" style="table-layout:fixed;">
<s:property value="devRun"/>
</div>
</td>
<td style="HEIGHT:22px" align="center" width="20%">
<s:date name="createDate" format="yyyy-MM-dd HH:mm:ss" />
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
</form>
<form name="Form2" id="Form2" method="post">
<table cellspacing="1" cellpadding="5" width="90%" align="center" bgcolor="#f5fafe" style="border:1px solid #8ba7e3" border="0">
<tr>
<td class="ta_01" colspan=2 align="center" background="${pageContext.request.contextPath }/images/b-info.gif">
<font face="宋体" size="2"><strong>运行监控编辑</strong></font>
</td>
</tr>
<tr height=10><td></td><td></td></tr>
<tr>
<td class="ta_01" align="center" bgcolor="#f5fafe" width="15%">站点运行情况:</td>
<td class="ta_01" bgcolor="#ffffff" style="word-break: break-all">
<s:textarea name="stationRun" id="stationRun" cssstyle="width: 1000px; height: 160px; padding: 1px;FONT-FAMILY: 宋体; FONT-SIZE: 9pt" onkeydown="if(event.keyCode==13)addEnter('stationRun');"></s:textarea>
<!--<script type="text/javascript">
CKEDITOR.replace("stationRun", {height:200, width:800});
</script>-->
</td>
</tr>
<tr>
<td class="ta_01" align="center" bgcolor="#f5fafe" width="15%">设备运行情况:</td>
<td class="ta_01" bgcolor="#ffffff" style="word-break: break-all">
<s:textarea name="devRun" id="devRun" cssstyle="width:1000px; height: 160px; padding:1px;FONT-FAMILY: 宋体; FONT-SIZE: 9pt" onkeydown="if(event.keyCode==13)addEnter('devRun');"></s:textarea>
<!-- <script type="text/javascript">
CKEDITOR.replace("devRun", {height:200, width:800});
</script> -->
</td>
</tr>
<tr>
<td class="ta_01" style="width: 100%" align="center" bgcolor="#f5fafe" colspan="2">
<input type="button" name="BT_Submit" value="保存" onclick="checkchar()" id="BT_Submit" style="font-size:12px; color:black; height:20px;width:50px">
<input style="font-size:12px; color:black; height:20px; width:80px" id="BT_Export" type="button" value="导出设置" name="BT_Export"
onclick="openWindow('${pageContext.request.contextPath }/system/exportExcel.jsp?belongTo=5-3','700','400')">
</td>
</tr>
</table>
</form>
</body>
</html>
You open script tag , But it is not closed,and
it is important to insert the script at the END of the page. So that the page
can register the controls first.
function checkchar(){
/*
if(document.Form2.stationRun.value.length>2500){
alert("站点运行情况字数不能超过2500字");
return;
}
if(document.Form2.devRun.value.length>2500){
alert("设备运行情况字数不能超过2500字");
return;
}
*/
//alert('before...');
//document.Form2.action="${pageContext.request.contextPath}/system/elecCommonMsgAction_save.do";
//document.Form2.submit();
alert(" 待办事宜保存成功!");
}
<input type="button" name="BT_Submit" value="保存" onclick="checkchar()" id="BT_Submit" style="font-size:12px; color:black; height:20px;width:50px">
Try this checkchar() function
function checkchar(){
alert("Hello");
}

jQuery Search multiple Tables for text and click a button if text is found

I'm trying to search some tables and click a button inside a cell of a specific table. This is my current code
links[1].click();
iimPlayCode('WAIT SECONDS = 2')
var compTabs = window.content.document.getElementById('compTabs')
var compTabList = compTabs.getElementsByClassName("tabNavigation top_tabs")
if (compTabList[0].children[0].innerText.match(/voting/gi)) {
$('#candidatesList').each(function () {
if ($(this).text().match(/john/gi)) { // search for text
// everything works fine until here, don't know how to click the specific button
//get id of button and click it
}
})
}
This is the result of $(this).text():
John
100%
05/09/2013
Vote
And this would be the result of $(this).html()
<tr style="text-align: center;">
<td><img src="http://somewebsite.com" width="36px"></td>
<td>John</td>
<td>100%</td>
<td>05/09/2013</td>
<td class="last-child"><button rel="123" id="6332" class="button_85 sa_vote">Vote</button></td>
</tr>
What I have to do is to click the button with that specific ID in this case '6332'.
This is a bit more complete html code.
<div id="compTabs">
<div class="tabs">
<ul class="tabNavigation top_tabs">
<li rel="#tab_voting" class="selected">
<table cellspacing="0" cellpadding="0">
<tbody><tr>
<td width="28px"><img src="http://somewebsite.com/design/img/new_style/tabs/voting.png"></td>
<td>Voting</td>
</tr>
</tbody></table>
</li>
<li rel="#tab_shareholders">
<table cellspacing="0" cellpadding="0">
<tbody><tr>
<td width="28px"><img src="http://somewebsite.com/design/img/new_style/tabs/shareholders.png"></td>
<td>Shareholders</td>
</tr>
</tbody></table>
</li>
</ul>
<div class="compTabsContent" id="tab_voting" style="display: block;">
<div style="height:390px;margin:0;" class="companyBody">
<table cellspacing="0" cellpadding="0" width="100%" style="margin-top: 10px;" class="proTable">
<tbody><tr valign="top">
<td style="text-align:center;height:35px;vertical-align:middle;font-size:14px;">
Vote to elect <b style="color:red"> General Director </b>. <div id="startTimer" class="timerStyle01">1d 22h:13m:30s</div>
</td>
</tr>
</tbody></table>
<table cellspacing="0" cellpadding="0" width="100%" style="margin-top:10px">
<tbody><tr valign="top"><td width="35%">
<table cellspacing="0" cellpadding="0" class="proTable newTable">
<thead>
<tr><th class="thb" colspan="3">All shareholders</th></tr>
<tr>
<th width="36px"> </th>
<th>Shareholder name</th>
<th>He voted</th>
</tr></thead>
<tbody id="listOfAdministrators">
<tr style="text-align: center;">
<td><img width="36px" src="http://somewebsite.com/content/user/small/user_1364379268_234.jpg"></td>
<td>John</td>
<td><img src="http://somewebsite.com/design/img/new_style/tabs/no.png"></td>
</tr>
</tbody>
</table>
</td>
<td width="10px"></td>
<td>
<table cellspacing="0" cellpadding="0" class="proTable newTable">
<thead>
<tr><th class="thb" colspan="5">Vote to elect <b style="color:red"> General Director </b>.</th></tr>
<tr>
<th width="36px"> </th>
<th>Shareholder name</th>
<th>Shares</th>
<th>Date of shares purchase</th>
<th> </th></tr>
</thead>
<tbody id="candidatesList">
<tr style="text-align: center;">
<td><img width="36px" src="http://somewebsite.com/content/user/small/user_1364379268_234.jpg"></td>
<td>John</td>
<td>100%</td>
<td>05/09/2013</td>
<td class="last-child"><button class="button_85 sa_vote" id="60928" rel="234">Vote</button></td>
</tr>
</tbody>
</table>
</td></tr>
</tbody></table>
</div></div>
<div class="compTabsContent" id="tab_shareholders" style="display: none;"><div style="height:390px;margin:0;" class="companyBody">
<table cellspacing="0" cellpadding="0" style="margin-top:15px;font-size: 11px;" class="proTable newTable">
<thead>
<tr><th style="font-size:13px;" class="thb" colspan="4">All shareholders</th></tr>
<tr>
<th width="36px" style="border-left: 1px solid #d2d2d2;"> </th>
<th>Shareholder name</th>
<th>Shares</th>
<th>Date of shares purchase</th>
</tr>
</thead>
<tbody>
<tr style="text-align: center;">
<td><img width="36px" src="http://somewebsite.com/content/user/small/user_1364379268_234.jpg"></td>
<td>John</td>
<td>100%</td>
<td class="last-child">05/09/2013</td>
</tr>
</tbody>
</table>
</div></div>
</div>
</div>
You may try a solution without jQuery, something like this:
links[1].click();
iimPlayCode(
"WAIT SECONDS=2" + "\n" +
"TAG POS=1 TYPE=TBODY ATTR=ID:candidatesList" + "\n" +
"TAG POS=R-1 TYPE=* ATTR=*" + "\n" +
"TAG POS=R1 TYPE=TD ATTR=TXT:*john*" + "\n" +
"TAG POS=R1 TYPE=BUTTON ATTR=TXT:Vote" + "\n"
);

PHP - Jquery - simple modal open data?

I have simply modal:
<div id="info" style="display: none;">
<h3 class="title">User info</h3>
<table border="0" cellpadding="5" cellspacing="0">
<tr>
<td width="50%" align="right">ID user:</td>
<td>1</td>
</tr>
<tr>
<td width="50%" align="right">Login:</td>
<td>1</td>
</tr>
</table>
</div>
And php script:
$get = mysql_query("SELECT * FROM users");
while($user = mysql_fetch_assoc($get)) {
echo 'Wyświetl info o '.$user['login'].'';
}
JS - Open info click:
$('.open_info').click(function(e){
$('#info').modal({
autoResize: true
});
return false;
});
And i dont know how show info from user this user data.
Help :(
You are opening a hidden div in modal, you should use hidden wrapper div and open inner div in modal.
<div style="display: none;">
<div id="info">
<h3 class="title">User info</h3>
<table border="0" cellpadding="5" cellspacing="0">
<tr>
<td width="50%" align="right">ID user:</td>
<td>1</td>
</tr>
<tr>
<td width="50%" align="right">Login:</td>
<td>1</td>
</tr>
</table>
</div>
</div>
Try using this method.
Try this..
$get = mysql_query("SELECT * FROM users");
while($user = mysql_fetch_assoc($get)) {
echo 'Wyświetl info o '.$user['login'].'';
echo '<div id="'.$user['id'].'" style="display: none;" >
<h3 class="title">User info</h3>
<table border="0" cellpadding="5" cellspacing="0">
<tr>
<td width="50%" align="right">ID user:</td>
<td>1</td>
</tr>
<tr>
<td width="50%" align="right">Login:</td>
<td>1</td>
</tr>
</table>
</div>';
}
$(".open_info").click(function(){
var getid = $(this).attr("id");
var docnumbers = new Array();
$('.open_info').each(function() {
var selectdoc=this.id;
if(getid==selectdoc)
{
$("#"+selectdoc).show();
} else {
$("#"+selectdoc).hide();
}
});
});

Categories

Resources