Copy link to clipboard
Copied
Hello,
next question,
I've two radio buttons in one group
[ ] as of now or [ ] due date also some seperate fields for day, month and year as [M][M][D][D][Y][Y]
Is there a possibility, if you click on the "as of due date" button, that all text fields for the date are activated (writable + required)?
If the "writeable first" does not work, it would be good to know how to make it then a required field.
Not sure why that's not working, but you can use this code to reset those fields to their default values:
this.resetForm(["Tag", "Monat", "Jahr"]);
Copy link to clipboard
Copied
Yes, that's possible. What are the names of the fields and the export values of the radio-button group?
Copy link to clipboard
Copied
group name = gilt
radio button 1 = ab sofort
radio button 2 = ab fälligkeit
3x textfields called:
- Tag
- Monat
- Jahr
Copy link to clipboard
Copied
You can use this code in one of the radio buttons to make fields writable and required
if you want them to be readonly and not required use same code in second radio button
just change true-false, false-true:
this.getField("Tag").required = true;
this.getField("Tag").readonly = false;
this.getField("Monat").required = true;
this.getField("Monat").readonly = false;
this.getField("Jahr").required = true;
this.getField("Jahr").readonly = false;
Copy link to clipboard
Copied
Thank you, this works almostly. But if I click on the 2nd radio button with this required code. And going back to the first radio button, the textfield are still required.
Copy link to clipboard
Copied
In second button change every "true" to "false" and "false" to "true":
Copy link to clipboard
Copied
Hello,
this works very well. Thank you.
Another question is, if people click on the second radio button and type something on textfields "Tag, Monat, Jahr" but now he decide to choose the first button. But these textfields should be cleared.
Copy link to clipboard
Copied
Add this to the code:
this.getField("Tag").value = "";
this.getField("Monat").value = "";
this.getField("Jahr").value = "";
Copy link to clipboard
Copied
It doesn't work. Text that has already been inserted will still remain and, as stated above in the code, the text field can no longer be edited.
Copy link to clipboard
Copied
Hmm, I've just add a space between "", now its "cleared"
Copy link to clipboard
Copied
but this is very dirty, another option to solve this problem without using space?
Copy link to clipboard
Copied
You can try use MouseUp event of radio buttons in action tab and choose "Reset a form" and select text fields.
Copy link to clipboard
Copied
hey so you've totally fixed my issue and ive been having this problem for a week now so thank you! im new to java but hoping i didn't get a head of myself with my current project. after selecting radio a specific radio button i begin typing in a text field and the coloring/styling goes away (the newely desired fields are working properly). Any ideas as to why this would be happening? Would I need to add something to the script? edit the newely exisiting one? thanks in advance!
Copy link to clipboard
Copied
Why is it "dirty"?
Copy link to clipboard
Copied
Not sure why that's not working, but you can use this code to reset those fields to their default values:
this.resetForm(["Tag", "Monat", "Jahr"]);