English 中文(简体)
MYMEMORY WARNING: YOU USED ALL AVAILABLE FREE TRANSLATIONS FOR TODAY. NEXT AVAILABLE IN 23 HOURS 56 MINUTES 00 SECONDS VISIT HTTPS://MYMEMORY.TRANSLATED.NET/DOC/USAGELIMITS.PHP TO TRANSLATE MORE
原标题:Using PHP inside of CSS and JavaScript

MYMEMORY WARNING: YOU USED ALL AVAILABLE FREE TRANSLATIONS FOR TODAY. NEXT AVAILABLE IN 23 HOURS 55 MINUTES 57 SECONDS VISIT HTTPS://MYMEMORY.TRANSLATED.NET/DOC/USAGELIMITS.PHP TO TRANSLATE MORE

MYMEMORY WARNING: YOU USED ALL AVAILABLE FREE TRANSLATIONS FOR TODAY. NEXT AVAILABLE IN 23 HOURS 55 MINUTES 55 SECONDS VISIT HTTPS://MYMEMORY.TRANSLATED.NET/DOC/USAGELIMITS.PHP TO TRANSLATE MORE

MYMEMORY WARNING: YOU USED ALL AVAILABLE FREE TRANSLATIONS FOR TODAY. NEXT AVAILABLE IN 23 HOURS 55 MINUTES 53 SECONDS VISIT HTTPS://MYMEMORY.TRANSLATED.NET/DOC/USAGELIMITS.PHP TO TRANSLATE MORE

MYMEMORY WARNING: YOU USED ALL AVAILABLE FREE TRANSLATIONS FOR TODAY. NEXT AVAILABLE IN 23 HOURS 55 MINUTES 52 SECONDS VISIT HTTPS://MYMEMORY.TRANSLATED.NET/DOC/USAGELIMITS.PHP TO TRANSLATE MORE

MYMEMORY WARNING: YOU USED ALL AVAILABLE FREE TRANSLATIONS FOR TODAY. NEXT AVAILABLE IN 23 HOURS 55 MINUTES 50 SECONDS VISIT HTTPS://MYMEMORY.TRANSLATED.NET/DOC/USAGELIMITS.PHP TO TRANSLATE MORE

<div class="container-xxl flex-grow-1 container-p-y">
             
<h2 align="center"><?php echo $appname?></h2><br />
   <div class="form-group">
   <form name="add_name" id="add_name">
                    
   <div class="table-responsive">
      <table class="table table-bordered" id="dynamic_field">
         <?php while ($checks = mysqli_fetch_array($checksqry)) {
            echo  <tr> ;
            echo  <td style="width: 20%"> .$checks[ check_name ].  <br><br> 
            <input type="radio" class="btn-check" name="btn[  . $checks[ id ] .  ]" id="btnpass[  . $checks[ id ] .  ]" value="Pass">
            <label class="btn rounded-pill btn-outline-success" for="btnpass[  . $checks[ id ] .  ]">Pass</label>&Tab;&Tab;
                    
           <input type="radio" class="btn-check" name="btn[  . $checks[ id ] .  ]" id="btnwarning[  . $checks[ id ] .  ]" value="Warning">
           <label class="btn rounded-pill btn-outline-warning" for="btnwarning[  . $checks[ id ] .  ]">Warning</label>&Tab;&Tab;
                    
           <input type="radio" class="btn-check" name="btn[  . $checks[ id ] .  ]" id="btnfail[  . $checks[ id ] .  ]" value="Fail">
           <label class="btn rounded-pill btn-outline-danger" for="btnfail[  . $checks[ id ] .  ]">Fail</label>&Tab;&Tab;
                    
           <button onclick="myFunction()" type="button" name="comment[  . $checks[ id ] .  ]" id="comment[  . $checks[ id ] .  ]" class="btn btn-info" style="float: right"><img src="assets/comment.png" width="20px"></button> 
<br><br>
           <div id="commentlinediv[  . $checks[ id ] .  ]">
           <input type="text" class="text-line" placeholder="Type Comment Here" id="commentline[  . $checks[ id ] .  ]"/>
</div>
</td> ;
echo  <tr> ;}?>
                        
</table>
<input type="button" name="submit" id="submit" class="btn btn-info" value="Submit" />
</div>
</form>
</div>
</div>
input[type="text"] {
   border:none; /* Get rid of the browser s styling */
   border-bottom:1px solid black; /* Add your own border */
}

.text-line {
   background-color: transparent;
   color: black;
   outline: none;
   outline-style: none;
   border-top: none;
   border-left: none;
   border-right: none;
   border-bottom: solid #eeeeee 1px;
   padding: 3px 10px;
   width: 300px;
}
                
#commentlinediv[<?php echo $checks[ id ]?>]{
   display: none;
}
function myFunction() {
document.getElementById("commentlinediv[<?php $checks[ id ]?>]").style.display = "inline";
}
问题回答

MYMEMORY WARNING: YOU USED ALL AVAILABLE FREE TRANSLATIONS FOR TODAY. NEXT AVAILABLE IN 23 HOURS 55 MINUTES 49 SECONDS VISIT HTTPS://MYMEMORY.TRANSLATED.NET/DOC/USAGELIMITS.PHP TO TRANSLATE MORE

<script>
function myFunction(var1) {
  
document.getElementById("commentlinediv[" + var1 + "]").style.display = "inline";
}

</script>

  1. Instead of specifying the commentlinediv as hidden, you may simply put it inline

MYMEMORY WARNING: YOU USED ALL AVAILABLE FREE TRANSLATIONS FOR TODAY. NEXT AVAILABLE IN 23 HOURS 55 MINUTES 47 SECONDS VISIT HTTPS://MYMEMORY.TRANSLATED.NET/DOC/USAGELIMITS.PHP TO TRANSLATE MORE

<div class="container-xxl flex-grow-1 container-p-y">
             
<h2 align="center"><?php echo $appname?></h2><br />
   <div class="form-group">
   <form name="add_name" id="add_name">
                    
   <div class="table-responsive">
      <table class="table table-bordered" id="dynamic_field">

   <?php while ($checks = mysqli_fetch_array($checksqry)) {
            echo  <tr> ;
            echo  <td style="width: 20%"> .$checks[ check_name ].  <br><br> 
            <input type="radio" class="btn-check" name="btn[  . $checks[ id ] .  ]" id="btnpass[  . $checks[ id ] .  ]" value="Pass">
            <label class="btn rounded-pill btn-outline-success" for="btnpass[  . $checks[ id ] .  ]">Pass</label>&Tab;&Tab;

           <input type="radio" class="btn-check" name="btn[  . $checks[ id ] .  ]" id="btnwarning[  . $checks[ id ] .  ]" value="Warning">
           <label class="btn rounded-pill btn-outline-warning" for="btnwarning[  . $checks[ id ] .  ]">Warning</label>&Tab;&Tab;

           <input type="radio" class="btn-check" name="btn[  . $checks[ id ] .  ]" id="btnfail[  . $checks[ id ] .  ]" value="Fail">
           <label class="btn rounded-pill btn-outline-danger" for="btnfail[  . $checks[ id ] .  ]">Fail</label>&Tab;&Tab;

           <button onclick="myFunction( . $checks[ id ] .  )" type="button" name="comment[  . $checks[ id ] .  ]" id="comment[  . $checks[ id ] .  ]" class="btn btn-info" style="float: right">Click</button> 
<br><br>
           <div style="display:none;" id="commentlinediv[  . $checks[ id ] .  ]">
           <input type="text" class="text-line" placeholder="Type Comment Here" id="commentline[  . $checks[ id ] .  ]"/>
</div>
</td> ;
echo  <tr> ;}?>

 </table>
<input type="button" name="submit" id="submit" class="btn btn-info" value="Submit" />
</div>
</form>
</div>
</div>

<style>
input[type="text"] {
   border:none; /* Get rid of the browser s styling */
   border-bottom:1px solid black; /* Add your own border */
}

.text-line {
   background-color: transparent;
   color: black;
   outline: none;
   outline-style: none;
   border-top: none;
   border-left: none;
   border-right: none;
   border-bottom: solid #eeeeee 1px;
   padding: 3px 10px;
   width: 300px;
}
                


</style>


<script>
function myFunction(var1) {
  
document.getElementById("commentlinediv[" + var1 + "]").style.display = "inline";
}

</script>

MYMEMORY WARNING: YOU USED ALL AVAILABLE FREE TRANSLATIONS FOR TODAY. NEXT AVAILABLE IN 23 HOURS 55 MINUTES 46 SECONDS VISIT HTTPS://MYMEMORY.TRANSLATED.NET/DOC/USAGELIMITS.PHP TO TRANSLATE MORE





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签