Href Modal not working

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP

Href Modal not working



I am new in PHP. My href modal doesn't work perfectly.
I am working on a database search with edit items function.


href



On initial load of the datatable, the edit anchor tag should return field values in
the modal form.


datatable



However it doesn't seem to work. When I clicked the icon it didn't do anything.
I am thinking maybe there is conflict between my search queries and div ids?



Here is my code:



My code for the search query:


$sql_result = mysql_query ($sql, $conn ) or die ( "Could not execute SQL
query" .$sql);
if (mysql_num_rows($sql_result)>0) {
while ($row = mysql_fetch_assoc($sql_result)) {
$project=$row['Project'];
$id=$row['ID'];
$discipline=$row['Discipline'];
$area_code=$row['Area_Code'];
$drawingnumber=$row['Drawing_Number'];
$documenttitle=$row['Document_Title'];
$approveddate=$row['Approved_Date'];
$revnumber=$row['Revision'];
$status=$row['Status'];
$transnumber=$row['Transmittal_No'];

//table row
<tr>
<td><?php echo $project; ?></td>
<td><?php echo $discipline; ?></td>
<td><?php echo $area_code ;?></td>
<td><?php echo $drawingnumber ;?></td>
<td><?php echo $documenttitle; ?></td>
<td><?php echo $approveddate; ?></td>
<td><?php echo $revnumber; ?></td>
<td><?php echo $status; ?></td>
<td><?php echo $transnumber; ?></td>
<td><?php echo $id; ?></td>
<div class='btn-group' role='group' aria-label='...'>
<td> <a href="#edit<?php echo $id;?>" data-toggle="modal"><button type='button' class='btn btn-warning btn-sm'>Edit<span class='glyphicon glyphicon-edit' aria-hidden='true'></span></button></a></td>
</div>
</tr>



My href edit Modal:


href


<div id="edit<?php echo $id; ?>" class="modal fade" role="dialog">
<form method="post" class="form-horizontal" role="form">
<div class="modal-dialog modal-lg">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Edit Item</h4>
</div>
<div class="modal-body">
<input type="hidden" name="edit_item_id" value="<?php echo $id; ?>">
<div class="form-group">
<label class="control-label col-sm-2" for="discipline">Discipline:</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="discipline" name="discipline" value="<?php echo $id; ?>" required autofocus>
</div>
<label class="control-label col-sm-2" for="area_code">Area Code:</label>
<div class="col-sm-4">
<input type="text" readonly class="form-control" id="area_code" name="area_code" value="<?php echo $area_code;?>" required>
</div>
<label class="control-label col-sm-2" for="drawingnumber">Drawing Number:</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="drawingnumber" name="drawingnumber" value="<?php echo $drawingnumber; ?>" required >
</div>
<label class="control-label col-sm-2" for="documenttitle">Document Title:</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="documenttitle" name="documenttitle" value="<?php echo $documenttitle; ?>" required >
</div>
<label class="control-label col-sm-2" for="approveddate">Approved Date:</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="approveddate" name="approveddate" value="<?php echo $approveddate; ?>" required>
</div>

<label class="control-label col-sm-2" for="revnumber">Revision Number:</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="revnumber" name="revnumber" value="<?php echo $revnumber; ?>" required >
</div>
<label class="control-label col-sm-2" for="status">Status:</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="status" name="status" value="<?php echo $status; ?>" required >
</div>
<label class="control-label col-sm-2" for="transnumber">Transmittal Number:</label>
<div class="col-sm-4">
<input type="text" class="form-control" id="transnumber" name="transnumber" value="<?php echo $transnumber; ?>" required >
</div>
</div>
</div>
</div>
</div>
</form>
</div>





edit your code and question properly for better understanding
– Bobby Axe
54 mins ago





I edited it guys. Hope it is understandable enough.. Let me know!
– juds
38 mins ago





Cant seem to get the correct href="#edit<?php echo $id ?>
– juds
34 mins ago





What about `data-target="#edit<?php echo $id ?>"
– GGw
3 mins ago









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Comments

Popular posts from this blog

Executable numpy error

PySpark count values by condition

Trying to Print Gridster Items to PDF without overlapping contents