I have a Search & Report datapage which contains a
Checkbox (PAT_Test)
Textfield (PAT_ID)
Textfield as a date (PAT_Inspection_Date)
Dropdown (PAT_Owner)
Radiobuttons (PAT_Test_Result)
If the checkbox is unchecked I want both textfields and the dropdown to be clear i.e. no value. I've been successful in making the radiobuttons all false
Here's the code:-
<script>
document.querySelector("input[name*='PAT_Test']").addEventListener("change", function test(){
//checks the checkbox if no
if(document.querySelector("input[name*='PAT_Test']").checked == false){
//wipe the PAT values
var ele = document.getElementsByName("EditRecordPAT_Test_Result");
for(var i=0;i<ele.length;i++){
ele[i].checked = false;
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Question
RonAnderson
I have a Search & Report datapage which contains a
If the checkbox is unchecked I want both textfields and the dropdown to be clear i.e. no value. I've been successful in making the radiobuttons all false
Here's the code:-
<script>
document.querySelector("input[name*='PAT_Test']").addEventListener("change", function test(){
//checks the checkbox if no
if(document.querySelector("input[name*='PAT_Test']").checked == false){
//wipe the PAT values
var ele = document.getElementsByName("EditRecordPAT_Test_Result");
for(var i=0;i<ele.length;i++){
ele[i].checked = false;
document.getElementById("EditRecordPAT_ID").value = "";
document.getElementById("EditRecordPAT_Owner").value = "";
document.getElementById("EditRecordPAT_Inspection_Date").value = "";
}}
});
</script>
Where the code is Bold, Underlined and italicised is where it's failing.
Your help would be greatly appreciated.
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.