Spaces:
Running
Running
neerajkalyank
commited on
Commit
•
2e62ddb
1
Parent(s):
b8d540d
Update app.py
Browse files
app.py
CHANGED
@@ -70,13 +70,21 @@ with gr.Blocks() as app:
|
|
70 |
pincode = gr.Number(label="Pincode", value=None, elem_id="pincode_field")
|
71 |
register_button = gr.Button("Register Patient")
|
72 |
registration_output = gr.Textbox(label="Registration Output")
|
73 |
-
copy_button = gr.Button("Copy Patient ID")
|
74 |
hidden_patient_id = gr.Textbox(visible=False) # Hidden field to store the patient ID
|
75 |
|
76 |
register_button.click(registration_interface, [name, father_name, age, phone, address, pincode], [registration_output, hidden_patient_id])
|
77 |
-
|
78 |
-
#
|
79 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
80 |
|
81 |
# Custom CSS styling
|
82 |
app.css = """
|
|
|
70 |
pincode = gr.Number(label="Pincode", value=None, elem_id="pincode_field")
|
71 |
register_button = gr.Button("Register Patient")
|
72 |
registration_output = gr.Textbox(label="Registration Output")
|
|
|
73 |
hidden_patient_id = gr.Textbox(visible=False) # Hidden field to store the patient ID
|
74 |
|
75 |
register_button.click(registration_interface, [name, father_name, age, phone, address, pincode], [registration_output, hidden_patient_id])
|
76 |
+
|
77 |
+
# Custom HTML for Copy ID Button
|
78 |
+
copy_id_html = """
|
79 |
+
<button onclick="copyPatientID()" style="background-color: #3b74f2; color: white; padding: 10px; border-radius: 5px; border: none; cursor: pointer;">Copy Patient ID</button>
|
80 |
+
<script>
|
81 |
+
function copyPatientID() {
|
82 |
+
navigator.clipboard.writeText(document.querySelector('#hidden_patient_id textarea').value);
|
83 |
+
alert('Patient ID copied to clipboard');
|
84 |
+
}
|
85 |
+
</script>
|
86 |
+
"""
|
87 |
+
gr.HTML(copy_id_html)
|
88 |
|
89 |
# Custom CSS styling
|
90 |
app.css = """
|