John Davidson

php - Input type = "text" name did not shown in print preview

0 comments
Message:


I have seem the similar question, why input-type="text" name did not working in print preview. SO, I try to print this project, but input-type="text" won't work. Anyone know how to solve this? I have see many solutions and won't work and I try in other browsers and won't work too.


This is the out put after I print preview.
print preview which data is input-type="text"


This is the code


<input type="hidden" name="id[]" value="<?php echo $row->id ?>">
<input type="hidden" name="student_session_id[]" value="<?php echo $row->student_session_id ?>">
<input type="hidden" name="semester[]" value="1">
<input type="hidden" name="evaluation_period[]" value="1">
<input type="text" name="surah[]" value="<?php echo $row->surah ?>" class="form-control" required>
<input type="text" name="score[]" value="<?php echo $row->score ?>" class="form-control" required>
<input type="text" disabled value="<?php echo $row->predicate ?>">

This is the data
data which I want to print preview


Anyone how to solve so the data from input type="text" is shown on print preview?



My Answer:
It seems like you are trying to print the values of the input fields in the print preview. However, input fields with type="hidden" or type="text" will not be displayed in the print preview by default.

If you want to display the values of these input fields in the print preview, you can use JavaScript to dynamically add the values to the print preview before printing.

Here is an example of how you can achieve this:

1. Add a print button to your page:

html



2. Add a script to dynamically add the values to the print preview before printing:

html



With this script, when you click the "Print" button, a new window will open with the values of the input fields displayed in the print preview. You can then print this preview with the values included.

I hope this helps! Let me know if you have any other questions.

Rate this post

4 of 5 based on 7178 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us