neerajkalyank commited on
Commit
c88ed1d
1 Parent(s): 6c55cc0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -12
app.py CHANGED
@@ -102,19 +102,21 @@ with gr.Blocks() as app:
102
 
103
  register_button.click(registration_interface, [name, father_name, age, phone, address, pincode], [registration_output, hidden_patient_id])
104
 
105
- # Custom HTML for Copy ID Button
106
  gr.HTML("""
107
- <button onclick="copyPatientID()" style="background-color: #3b74f2; color: white; padding: 10px; border-radius: 5px; border: none; cursor: pointer;">Copy Patient ID</button>
108
- <script>
109
- function copyPatientID() {
110
- const patientID = document.querySelector('#hidden_patient_id input').value;
111
- navigator.clipboard.writeText(patientID).then(() => {
112
- alert('Patient ID copied to clipboard');
113
- }).catch(err => {
114
- alert('Failed to copy Patient ID');
115
- });
116
- }
117
- </script>
 
 
118
  """)
119
 
120
  with gr.Tab("Tests"):
 
102
 
103
  register_button.click(registration_interface, [name, father_name, age, phone, address, pincode], [registration_output, hidden_patient_id])
104
 
105
+ # Custom HTML for Copy ID Button
106
  gr.HTML("""
107
+ <div style="margin-top: 10px;">
108
+ <button onclick="copyPatientID()" style="background-color: #3b74f2; color: white; padding: 10px; border-radius: 5px; border: none; cursor: pointer;">Copy Patient ID</button>
109
+ <script>
110
+ function copyPatientID() {
111
+ const patientID = document.querySelector('[aria-label="hidden_patient_id"] textarea').value;
112
+ navigator.clipboard.writeText(patientID).then(() => {
113
+ alert('Patient ID copied to clipboard');
114
+ }).catch(err => {
115
+ alert('Failed to copy Patient ID');
116
+ });
117
+ }
118
+ </script>
119
+ </div>
120
  """)
121
 
122
  with gr.Tab("Tests"):