Maximum number of Modals in Bootstrap PHP - php

Does Bootstrap has a maximum number of Modals allowed per page?
I have a total of 3 modals that will be used on the page.
1 is an modal-sm which will be used for Admin Login.
1 modal-lg which will be used as an Asset Add window.
and 1 modal-lg which will be used as an Asset Edit window
The Admin Login and Asset Addition window works. But when I try to open the Asset Edit window, the modal doesn't show up but the backdrop goes dark.
When I delete the Admin Login modal and the Asset addition window's code, the Asset Edit window works.
Please take note that as of the moment, Asset Addition and Asset Edit windows have exactly the same code. The Asset Addition works but the Asset Edit does not.
This just bugs me so hard. I'll really appreciate your assistance.
Admin Window:
<div class="modal fade" id="adminModal" role="dialog">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div style="padding-top:20px;">
<center>
<img src="TISAMI2.png" style="height:100px;">
<br><br>
<h4 class="modal-title" style="font-family:'Encode Sans Expanded'; font-weight:600;">Admin Login</h4>
<div class="modal-body">
<br>
<form action=adminlogin.php method=POST>
<p><span style="font-family:'Encode Sans Expanded';">Username</span>
<br><input type=text name="username">
</p>
<p><span style="font-family:'Encode Sans Expanded';">Password</span>
<br><input type=password name="password">
<p>
<br>
</center>
</div>
<div class="modal-footer">
<input type=submit class="btn btn-Success" value=Sign-In>
</form>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
Asset Add Window:
<div class="modal fade" id="addDLModal" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div style="padding-top:20px; padding-right:20px; padding-left:20px; min-width:800px;">
<center>
<img src="TISAMI2.png" style="height:100px;">
<BR><BR>
<h4 class="modal-title" style="font-family:'Encode Sans Expanded'; font-weight:600;">Desktop and Laptop Asset Information</h4>
</center>
<div class="modal-body">
<br>
<form>
<p><span style="font-family:'Encode Sans Expanded';">Status:</span>
<select class=dlStatus id=dlStatus disabled>
<option>IN STOCK
<option>IN USE
</select>
<p><span style="font-family:'Encode Sans Expanded';">Asset Information</span>
<table style="width:100%; margin-left:20px;">
<tr>
<td width=20%>Unit Type:
<td width=20%><input type=text class=dlType id=dlType disabled>
<!-- <td width=20%><div class=dlType id=dlType> -->
<td width=20%>Computer Name:
<td width=20%><input type=text class=dlCName id=dlCName disabled>
</tr>
<tr>
<td>Brand:
<td><input type=text class=dlBrand id=dlBrand disabled>
<td>Model:
<td><input type=text class=dlModel id=dlModel disabled>
</tr>
<tr>
<td>Asset Tag:
<td><input type=text class=dlAssetTag id=dlAssetTag disabled>
<td>Remarks:
<td><input type=text class=dlPlus id=dlPlus disabled>
</tr>
<tr>
<td>Serial No.:
<td><input type=text class=dlSerialNo id=dlSerialNo disabled>
<td>Overall Condition:
<td><input type=text class=dlOACondition id=dlOACondition>
</tr>
<tr>
<td>MAC Address:
<td><input type=text class=dlMAC id=dlMAC disabled>
<td>Useable:
<td><input type=text class=dlUse id=dlUse>
</tr>
</table>
<p><span style="font-family:'Encode Sans Expanded';">User Information</span>
<table style="width:100%; margin-left:20px;">
<tr>
<td width=20%>IGG:
<td width=20%><input type=text class=dlIGG id=dlIGG>
<td width=20%>Full Name:
<td width=20%><input type=text class=dlFullName id=dlFullName>
</tr>
<tr>
<td>Department:
<td><input type=text class=dlDepartment id=dlDepartment>
<td>Office:
<td><input type=text class=dlOffice id=dlOffice>
</tr>
</table>
<p><span style="font-family:'Encode Sans Expanded';">Accessories Details</span>
<table style="width:100%; margin-left:20px;">
<tr>
<td width=16%>Keyboard:
<td width=16%><input type=checkbox class=dlKeyboard id=dlKeyboard>
<td width=16%>Mouse:
<td width=16%><input type=checkbox class=dlMouse id=dlMouse>
<td width=16%>Charger:
<td width=16%><input type=checkbox class=dlCharger id=dlCharger>
</tr>
<tr>
<td>Bag:
<td><input type=checkbox class=dlBag id=dlBag>
<td>Docking Station:
<td><input type=checkbox class=dlDockingStation id=dlDockingStation>
<td>UPS:
<td><input type=checkbox class=dlUPS id=dlUPS>
</tr>
<tr>
<td>Monitor 1:
<td><input type=checkbox class=dlMonitor1 id=dlMonitor1>
<td>Monitor 2:
<td><input type=checkbox class=dlMonitor2 id=dlMonitor2>
<td>
<td>
</tr>
</table>
<p><span style="font-family:'Encode Sans Expanded';">Previous Owner Information</span>
<table style="width:100%; margin-left:20px;">
<tr>
<td width=20%>Employee Number:
<td width=20%><input type=text class=dlPrevIGG id=dlPrevIGG>
<td width=20%>Full Name:
<td width=20%><input type=text class=dlPrevName id=dlPrevName>
</tr>
</table>
</form>
<br>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success" data-dismiss="modal">Save</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
Asset Edit Window:
<div class="modal fade" id="editDLModal" role="dialog">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div style="padding-top:20px; padding-right:20px; padding-left:20px; min-width:800px;">
<center>
<img src="TISAMI2.png" style="height:100px;">
<BR><BR>
<h4 class="modal-title" style="font-family:'Encode Sans Expanded'; font-weight:600;">Desktop and Laptop Asset Information</h4>
</center>
<div class="modal-body">
<br>
<form>
<p><span style="font-family:'Encode Sans Expanded';">Status:</span>
<select class=dlStatus id=dlStatus disabled>
<option>IN STOCK
<option>IN USE
</select>
<p><span style="font-family:'Encode Sans Expanded';">Asset Information</span>
<table style="width:100%; margin-left:20px;">
<tr>
<td width=20%>Unit Type:
<td width=20%><input type=text class=dlType id=dlType disabled>
<!-- <td width=20%><div class=dlType id=dlType> -->
<td width=20%>Computer Name:
<td width=20%><input type=text class=dlCName id=dlCName disabled>
</tr>
<tr>
<td>Brand:
<td><input type=text class=dlBrand id=dlBrand disabled>
<td>Model:
<td><input type=text class=dlModel id=dlModel disabled>
</tr>
<tr>
<td>Asset Tag:
<td><input type=text class=dlAssetTag id=dlAssetTag disabled>
<td>Remarks:
<td><input type=text class=dlPlus id=dlPlus disabled>
</tr>
<tr>
<td>Serial No.:
<td><input type=text class=dlSerialNo id=dlSerialNo disabled>
<td>Overall Condition:
<td><input type=text class=dlOACondition id=dlOACondition>
</tr>
<tr>
<td>MAC Address:
<td><input type=text class=dlMAC id=dlMAC disabled>
<td>Useable:
<td><input type=text class=dlUse id=dlUse>
</tr>
</table>
<p><span style="font-family:'Encode Sans Expanded';">User Information</span>
<table style="width:100%; margin-left:20px;">
<tr>
<td width=20%>IGG:
<td width=20%><input type=text class=dlIGG id=dlIGG>
<td width=20%>Full Name:
<td width=20%><input type=text class=dlFullName id=dlFullName>
</tr>
<tr>
<td>Department:
<td><input type=text class=dlDepartment id=dlDepartment>
<td>Office:
<td><input type=text class=dlOffice id=dlOffice>
</tr>
</table>
<p><span style="font-family:'Encode Sans Expanded';">Accessories Details</span>
<table style="width:100%; margin-left:20px;">
<tr>
<td width=16%>Keyboard:
<td width=16%><input type=checkbox class=dlKeyboard id=dlKeyboard>
<td width=16%>Mouse:
<td width=16%><input type=checkbox class=dlMouse id=dlMouse>
<td width=16%>Charger:
<td width=16%><input type=checkbox class=dlCharger id=dlCharger>
</tr>
<tr>
<td>Bag:
<td><input type=checkbox class=dlBag id=dlBag>
<td>Docking Station:
<td><input type=checkbox class=dlDockingStation id=dlDockingStation>
<td>UPS:
<td><input type=checkbox class=dlUPS id=dlUPS>
</tr>
<tr>
<td>Monitor 1:
<td><input type=checkbox class=dlMonitor1 id=dlMonitor1>
<td>Monitor 2:
<td><input type=checkbox class=dlMonitor2 id=dlMonitor2>
<td>
<td>
</tr>
</table>
<p><span style="font-family:'Encode Sans Expanded';">Previous Owner Information</span>
<table style="width:100%; margin-left:20px;">
<tr>
<td width=20%>Employee Number:
<td width=20%><input type=text class=dlPrevIGG id=dlPrevIGG>
<td width=20%>Full Name:
<td width=20%><input type=text class=dlPrevName id=dlPrevName>
</tr>
</table>
</form>
<br>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success" data-dismiss="modal">Save</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
This just bugs me so hard. I'll really appreciate your assistance.
EDITED

There is no limit for Bootstrap Modals in one page.
Check whether your modals have similar ID or name.
Issue can be within the transitions. Please refer the
link: https://getbootstrap.com/docs/4.2/components/modal/#methods
All API methods are asynchronous and start a transition. They return to the caller as soon as the transition is started but before it ends. In addition, a method call on a transitioning component will be ignored.

Related

Table Showing even in modal but the paragraph doesnt show

This is my code for my modal. im having a problem on my table because it is still showing. but when its only the paragraph tag, the words inside there are not showing. i already tried putting the table inside the p tag but still showing . what could i possibly do?
<!-- Modal for CONFIRM-->
<div class="modal fade" id="ModalConfirm<?php echo $id;?>" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-body">
<p>Are you sure you want to confirm request?<?php echo $id?> </p>
<?php
$modalquery="select * from tbl_informant,tbl_missing_person,tbl_contact_person
where concat(reported_id=mp_id && mp_id=cp_id) && informant_id=".$id;
$modalresult=mysql_query($modalquery);
while ($row=mysql_fetch_array($modalresult)) {
?>
<form method="POST" action="">
<table border=1 width="120%" style="margin-left: 60px;">
<tr >
<td colspan="3" height="40px">
<center>
<b>INFORMANTS INFORMATION</b>
</center>
</td>
</tr>
<tr>
<td>
<b>Informants Name</b>
</td>
<td>
<?php echo $row['informant_fname'].' '.$row['informant_lname'];?>
</td>
</tr>
<tr>
<td>
<b>Address:</b>
</td>
<td colspan="2">
<?php echo $row['informants_address'];?>
</td>
</tr>
<tr>
<td>
<b>Contact</b>
</td>
<td >
<input type="number" name="informant_contact" placeholder="Enter Your Number"></input>
</td>
<td>
<input type="email" name="informant_email" placeholder="Enter Your Email"></input>
</td>
</tr>
</table><br><br>
<table border=1 width="120%" style="margin-left: 60px;">
<tr>
<td colspan="3" height="40px" >
<center>
<b>SIGHTING INFORMATION</b>
</center>
</td>
</tr>
<tr>
<td>
<b>Upper Apparel</b>
</td>
<td>
<?php echo$row['si_upper'];?>
</td>
<td>
<b>Lower Apparel</b>
</td>
<td>
<?php echo$row['si_lower'];?>
</td>
</tr>
<tr>
<td >
<b>Last Location Seen:</b>
</td>
<td colspan="2">
<center>
<textarea cols="40" rows="3" placeholder="Enter the Last Location You've seen him/her" name="si_location"></textarea>
</center>
</td>
</tr>
<tr>
<td>
<b>
Childs Last Action/ Doing
</b>
</td>
<td colspan="2">
<center>
<textarea cols="40" rows="3" placeholder="Enter The Childs Last Activity" name="si_activity"></textarea>
</center>
</td>
</tr>
<tr>
<td colspan="3" height="50px">
<center>
<input type="submit" name="btnSubmit" value="SUBMIT"></input>
</center>
</td>
</tr>
</table><br><br><br>
</form>
<?php
}
?>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" >Yes</button>
<button type="button" class="btn btn-default" data-dismiss="modal">No</button>
</div>
</div>
this is all of the code that my confirm button should have but when it has tables the yes or no button also shows outside the modal.

get_cellmap() issue with DomPDF

I'm working with DomPdf and trying to convert my file into pdf but facing a strange error given below
I googled many times and read different forums but didn't get the reason for this error.
Please help me guys.
Fatal error: Uncaught Error: Call to a member function get_cellmap()
on null in
C:\xampp\htdocs\dom\dompdf\src\FrameReflower\TableCell.php:37 Stack
trace: #0
C:\xampp\htdocs\dom\dompdf\src\FrameDecorator\AbstractFrameDecorator.php(893):
Dompdf\FrameReflower\TableCell->reflow(NULL) #1
C:\xampp\htdocs\dom\dompdf\src\FrameReflower\TableRow.php(52):
Dompdf\FrameDecorator\AbstractFrameDecorator->reflow() #2
C:\xampp\htdocs\dom\dompdf\src\FrameDecorator\AbstractFrameDecorator.php(893):
Dompdf\FrameReflower\TableRow->reflow(NULL) #3
Code
require_once './dompdf/autoload.inc.php';
use Dompdf\Dompdf;
$dompdf = new Dompdf();
$dompdf->loadHtml(file_get_contents('./my-file.php'));
$dompdf->setPaper('A4','landscape');
$dompdf->render();
$dompdf->stream('codexworld',array('Attachment'=>0));
my-file.php
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div id="page-wrap">
<form method="post" action="save_view.php" novalidate="">
<div id="header">
<h2 class="title" style="text-decoration: underline;font-size:2em;font-family: Brush Script Mt;">Pro Tech Diagnostics</h2>
<!-- <img id="image" width="auto" src="images/Logo.png" alt="logo" height="60"/>-->
<div class="adjust_contact">
<p>26893 Bouquet Canyon Rd. Suite C204 Saugus, CA 91350</p>
<div class="parent">
<p class="left">Phone # (818)644-1965</p>
<p class="right">Fax # (661) 468-7504</p>
</div>
</div>
</div>
<div id="identity">
<div id="header1">
<h3>Customer Info</h3>
</div>
</div>
<div style="clear:both"></div>
<!-- <textarea id="customer-title">Widget Corp.
c/o Steve Widget</textarea>-->
<div id="customer">
<div id="parent">
<table id="meta" style="overflow: wrap" class="left1">
<tr>
<td class="meta-head">Name</td>
<td>
<input name="name" type="text"/>
</td>
</tr>
<tr>
<td class="meta-head">Address</td>
<td>
<input name="address" type="text"/>
</td>
</tr>
<tr>
<td class="meta-head">Phone</td>
<td>
<input required="required" name="phone" type="text"/>
</td>
</tr>
</table>
<table id="meta" style="overflow: wrap" class="right1">
<tr>
<td class="meta-head">Invoice#</td>
<td>
<input required="required" name="invoice" type="text"/>
</td>
</tr>
<tr>
<td class="meta-head">Paid Date</td>
<td>
<input required="required" name="date" type="text"/>
</td>
</tr>
</table>
</div>
</div>
<!-----------------------3 columns Table Section------------------------->
<div id="identity">
<div id="header1-1">
<h3>Vehicle Info</h3>
</div>
</div>
<div class="Row">
<div class="Column">
<table id="meta" style="overflow: wrap" class="left1">
<span class="parent">
<tr>
<td class="meta-head">Make:</td>
<td>
<input required="required" name="make" type="text"/>
</td>
</tr>
<tr>
<td class="meta-head">Model:</td>
<td>
<input required="required" name="model" type="text"/>
</td>
</tr>
</span>
<tr>
<td class="meta-head">Year:</td>
<td>
<input required="required" name="year" type="text"/>
</td>
</tr>
</table>
</div><!--1st table-->
<div class="Column">
<table id="meta" style="overflow: wrap" class="left1">
<span class="parent">
<tr>
<td class="meta-head">Vin #:</td>
<td>
<input required="required" name="vin" type="text"/>
</td>
</tr>
<tr>
<td class="meta-head">Lic.#:</td>
<td>
<input required="required" name="lic" type="text"/>
</td>
</tr>
</span>
<tr>
<td class="meta-head">Miles:</td>
<td>
<input required="required" name="miles" type="text"/>
</td>
</tr>
</table>
</div><!--2nd table-->
<div class="Column">
<table id="meta" style="overflow: wrap" class="left1">
<span class="parent">
<tr>
<td class="meta-head">Color:</td>
<td>
<input required="required" name="color" type="text"/>
</td>
</tr>
<tr>
<td class="meta-head">R.O. #:</td>
<td>
<input required="required" name="ro" type="text"/>
</td>
</tr>
</span>
<tr>
<td class="meta-head">P.O. #:</td>
<td>
<input required="required" name="po" type="text"/>
</td>
</tr>
</table>
</div><!--3rd table-->
</div><!--End 3 column table row-->
<table id="items" style="overflow: wrap; margin-top: 100px;">
<tr>
<th colspan="6">Descryption</th>
<th>Hrs</th>
<th colspan="1">Amount</th>
</tr>
<tr class="item-row">
<td colspan="6" class="item-name">
<textarea style="padding-bottom: 300px;" name="description" rows="12" cols="5"></textarea>
<p style="font-weight: bold">*******All Parts Supplied By Shop*******</p>
</td>
<td>
<input name="hrs" type="text"/>
</td>
<td colspan="5">
<input required="required" name="amount" type="text"/>
</td>
</tr>
<tr>
<td colspan="4">Technician #: 81 (Miguel A.)</td>
<td style="border: none;" colspan="2">Labor Hrs:</td>
<td colspan="1"><input placeholder="0" name="labourHrs" type="text"/></td>
<td colspan="1"></td>
</tr>
<tr>
<td colspan="2">Labor Rate (Per Hr):</td>
<td colspan="2"><input placeholder="60" required="required" name="labourRate" type="text"/></td>
<td style="border: none;" colspan="2">Labor Price:</td>
<td colspan="1"><input placeholder="0" name="labourPrice" type="text"/></td>
<td colspan="1"></td>
</tr>
<tr>
<td style="border: none;" colspan="4"></td>
<td style="border: none;" colspan="2">Total</td>
<td colspan="1"></td>
<td colspan="1"><input placeholder="0" name="total" type="text"/></td>
</tr>
<tr>
<td style="border: none" colspan="4"></td>
<td colspan="3">Grand Total</td>
<td colspan="1"><input placeholder="$0.00" name="gTotal" type="text"/></td>
</tr>
<tr>
<td colspan="4">Signature Approval:</td>
<td colspan="4"></td>
</tr>
<tr>
<td style="border: none" colspan="4"></td>
<td style="border-right: none;" colspan="4">Paid</td>
</tr>
<tr class="no-border">
<td colspan="4"></td>
<td></td>
<td >Yes<input type="checkbox" name="one" value="Yes( ✓ )"></td>
<td>No ( )<input type="checkbox" name="two" value="No( ✓ )"></td>
<td>P.O. ( )<input type="checkbox" name="three" value="P.O( ✓ )"></td>
</tr>
<tr>
<td colspan="8">
<p style="font-size: 10px">Not responsible for loss by fire or theft or any other cause beyond our control. I hereby authorize the above repair work to be done with the necessary material & grant
permission to operate equipment for purpose of testing and inspection. An express mechanic's lien is acknowledged to secure the amount of repairs. I agree to pay
the payment in full no later than 30 days after work has been completed. After 30 days, a 1.4% monthly charge will be added to the outstanding balance.
</p>
</td>
</tr>
</table>
</div>
<h2 style="text-decoration: underline;font-style: italic;text-align: center; font-weight: bold;font-family: Brush Script Mt;">
Thanks for Your Business
</h2>
<input name="submit" class="submit" type="submit" value="Submit"/>
</form>
</body>
</html>
DomPDF make conflict with CSS properties like display
I don't know why but try to remove display properties
If you are using table and you are facing this problem then
There are two tricks which work for me.
I don't know if this trick is correct solutions or not.
Check Number of td should be same in all tr inside your table.
If you have used tfooter then remove that tfooter and place that tr inside tbody.
It might help you.
I thought that was table-bordered, a CSS issue, but was HTML, I had thead and tr tags, I removed thead tag:
before:
<thead>
<tr>
...
</tr>
</thead>
...
after:
<tr>
...
</tr>
Worked for me.
I didn't find out, because with little data (10) worked fine but with more data (15-20) it returned this error
I found this issue caused by CSS (I had padding in mm)
Got this error, too. Reasons was a malformed html, sonw rows had a colspan="4", but other rowd only three , also and were missing.
When I fixed the html, the error was gone.
I also had this issue and when I removed all responsive part or css from the table tag then it's work properly.
So remove this part style="overflow: wrap" from your Table tag.

Responsinve Form which will initially display data from an PHP variable in a Table

my requirement form link
I have made an html form that displays data from an PHP variable. The Form contains a table and that table has number of rows based on a PHP variable.
but problem is that form is not responsive can you please give some idea how can i made a responsive form with table that will load data from an PHP variable. my current code is below:
<div class="row">
<div class="col-md-8">
<form method="POST" action="/updateInfo" enctype="multipart/form-data" name="InfoForm">
<div style ="width:100%; height:250px;">
<table style = "width:100%;border:2px;height:60%;">
<tr style = "border-bottom: thin solid;background-color:#9a004b;color:White">
<th></th>
<th>Register Date</th>
<th>Reconciliation Date</th>
<th>Amount</th>
<th>IBAN</th>
<th>Withhold</th>
</tr>
<?php foreach($overpayment as $key=>$value){
if(empty($value['ReconciliationDate'])){
?> <tr style="border:1px solid #9a004b;background-color: White">
<div class="row">
<td><input type="hidden" name=OverpaymentNr[] value="<?php echo $value['OverpaymentNr']?>"</td>
<td><label name=Paydate[] value=""/><?php echo $value['RegisterDate']?></td>
<td><label name=ReconciliationDate[] value=""/><?php echo $value['ReconciliationDate']?></td>
<td><label name=Amount[] value=""/><?php echo $value['Amount']?></td>
<td><input type="text" style="width:186px; height:35px;" name=IBAN[] value="<?php echo $value['IBAN']?>"/> </td>
<td><label name=Withhold[] value=""/><?php echo $value['Withhold']?></td>
</div>
</tr>
<?php }
}
?>
<tr style="border-top:1px solid #9a004b;">
<td></td>
<td></td>
<td></td>
<td align="center"><input type="Submit" class="btn btn-danger pull-right" name= Submit value = Submit /> </td>
<td></td>
</tr>
</table>
</div>
</form>
</div>
</div>

How to get record from table content as a data for popup form and displayed

the table content that i made as button for popup.
this popup has a function for input form and link to another page
here for the example of my table
<div>
<table width="1023" height="248" border="1">
<td><div align="center"><input type="button" onclick="popup_window_show('#sample', { pos : 'tag-right-down', parent : this, width : '270px' });" value="A1.8" /></td>
</table>
</div>
my popup form like this
<div class="popup_window_css" id="sample">
<table class="popup_window_css">
<tr class="popup_window_css">
<td class="popup_window_css">
<div class="popup_window_css_head"><img src="images/close.gif" alt="" width="9" height="9" />Aksi</div>
<div class="popup_window_css_body"><div style="border: 1px solid #808080; padding: 6px; background: #FFFFFF;">
<form method="post" action="">
<table>
<tr>
<td> Werehouse </td>
<tr>
<td> Posisi</td>
<td> <input type='text' name="p" value="" /></td>
</tr>
<tr>
<td> Product ID</td>
<td> <input type='text' name="id" /></td>
</tr>
<tr>
<td> Product Name</td>
<td> <input type='text' name="nama" /></td>
</tr>
<tr>
<td> Production Date</td>
<td> <input type='text' name="tgl" /></td>
</tr>
<tr>
<td colspan='2' align='right'>
<input type='submit' value= 'Save'>
<input type='reset' value='Reset' />
<input type='button' value='view' onclick=\"window.location.href='#';\"/>
</td>
</tr>
</table>
</div></div>
may be this screen shoot can help you to understand my problem
https://www.dropbox.com/s/bwil302fdzhe0f5/New%20Picture%20%2829%29.bmp
my Question
how to get button value as data for popup form and automaticly shown in form "posisi"?
tq for Ricky this the answer
<script>
function setvalue(values) {
document.getElementById('posisi').value = values;
}
</script>
<div>
<table width="1023" height="248" border="1">
<tr>
<td>
<input type="button" onclick="setvalue(this.value);" value="A1.8" />
</td>
</tr>
</table>
</div>
<div class="popup_window_css" id="sample">
<table class="popup_window_css">
<tr class="popup_window_css">
<td class="popup_window_css">
<div class="popup_window_css_head">
<img src="images/close.gif" alt="" width="9" height="9" />Aksi</div>
<div class="popup_window_css_body">
<div style="border: 1px solid #808080; padding: 6px; background: #FFFFFF;">
<form method="post" action="">
<table>
<tr>
<td>Werehouse</td>
<tr>
<td>Posisi</td>
<td>
<input type='text' name="p" id="posisi" />
</td>
</tr>
<tr>
<td>Product ID</td>
<td>
<input type='text' name="id" />
</td>
</tr>
<tr>
<td>Product Name</td>
<td>
<input type='text' name="nama" />
</td>
</tr>
<tr>
<td>Production Date</td>
<td>
<input type='text' name="tgl" />
</td>
</tr>
<tr>
<td colspan='2' align='right'>
<input type='submit' value='Save'>
<input type='reset' value='Reset' />
<input type='button' value='view' onclick=\ "window.location.href='#';\"/>
</td>
</tr>
</table>
</div>
</div>
you can cek here http://jsfiddle.net/JLExZ/
you can use HTML5 data-attributes concept to set value in form data like
and receive the data by JavaScript.
<div id="awesome"
data-hash="3e4ae6c4e30e50e4fdfc7bf439a09974">Some awesome data</div>
var dataHashValue = jQuery("#awesome").data('hash');
console.log(dataHashValue);

how to make the table content wil shown automaticly in pop up form

i try to make a table in my web. Table content have value that i use for parameter in the next action and automaticly shown on form.
here my skenario
the content of the table as button for my popup like this
<div>
<table width="1023" height="248" border="1">
<tr>
<th colspan="2" scope="col">A1</th>
<th colspan="2" scope="col">A2</th>
<th colspan="2" scope="col">A3</th>
</tr>
<tr>
<td><div align="center"><input type="button" onclick="popup_window_show('#sample', { pos : 'tag-right-down', parent : this, width : '270px' });" value="A1.4" /></td>
<td><div align="center"><input type="button" onclick="popup_window_show('#sample', { pos : 'tag-right-down', parent : this, width : '270px' });" value="A1.8" /></td>
<td><div align="center"><input type="button" onclick="popup_window_show('#sample', { pos : 'tag-right-down', parent : this, width : '270px' });" value="A2.4" /></td>
<td><div align="center"><input type="button" onclick="popup_window_show('#sample', { pos : 'tag-right-down', parent : this, width : '270px' });" value="A2.8" /></td>
<td><div align="center"><input type="button" onclick="popup_window_show('#sample', { pos : 'tag-right-down', parent : this, width : '270px' });" value="A3.4" /></td>
<td><div align="center"><input type="button" onclick="popup_window_show('#sample', { pos : 'tag-right-down', parent : this, width : '270px' });" value="A3.8" /></td>
</tr>
</div>
this my popup_window_show
<div class="popup_window_css" id="sample">
<div class="popup_window_css_head"><img src="images/close.gif" alt="" width="9" height="9" />Aksi</div>
<div class="popup_window_css_body"><div style="border: 1px solid #808080; padding: 6px; background: #FFFFFF;">
<form method="post" action="">
<table width="200">
<tr>
<td colspan='2' align='center'> WHK </td>
<tr>
<td> Posisi :</td>
<td> <input type='text' name="p" /></td>
</tr>
<tr>
<td> Product ID :</td>
<td> <input type='text' name="id" /></td>
</tr>
<tr>
<td> Product Name :</td>
<td> <input type='text' name="nama" /></td>
</tr>
<tr>
<td> Production Date :</td>
<td> <input type='text' name="tgl" /></td>
</tr>
<tr>
<td colspan='2' align='right'>
<input type='submit' value= 'Save'>
<input type='reset' value='Reset' />
<input type='button' value='view' onclick=\"window.location.href='#';\"/>
</td>
</tr>
</table>
</div>
</div>
my focus problem how to make the table content will shown automaticly in popup form at Posisi coloumn.
ex: when the user clik A1.4 so in "posisi" coloumn automaticly have value A1.4 and displayed
And then when user click view button, "web" guide the user to a new page that displayed database which table content as parameter.
may be this http://jsfiddle.net/andricoga/k4BB3/#base can help to understand my problem
my english still weak, i hope you understand what i mean and give solve for me tq
yes i find that
<script>
function setvalue(values) {
document.getElementById('posisi').value = values;
}
</script>
<div>
<table width="1023" height="248" border="1">
<tr>
<td>
<input type="button" onclick="setvalue(this.value);" value="A1.8" />
</td>
</tr>
</table>
</div>
<div class="popup_window_css" id="sample">
<table class="popup_window_css">
<tr class="popup_window_css">
<td class="popup_window_css">
<div class="popup_window_css_head">
<img src="images/close.gif" alt="" width="9" height="9" />Aksi</div>
<div class="popup_window_css_body">
<div style="border: 1px solid #808080; padding: 6px; background: #FFFFFF;">
<form method="post" action="">
<table>
<tr>
<td>Werehouse</td>
<tr>
<td>Posisi</td>
<td>
<input type='text' name="p" id="posisi" />
</td>
</tr>
<tr>
<td>Product ID</td>
<td>
<input type='text' name="id" />
</td>
</tr>
<tr>
<td>Product Name</td>
<td>
<input type='text' name="nama" />
</td>
</tr>
<tr>
<td>Production Date</td>
<td>
<input type='text' name="tgl" />
</td>
</tr>
<tr>
<td colspan='2' align='right'>
<input type='submit' value='Save'>
<input type='reset' value='Reset' />
<input type='button' value='view' onclick=\ "window.location.href='#';\"/>
</td>
</tr>
</table>
</div>
</div>
you can cek here http://jsfiddle.net/JLExZ/

Categories