I think you can try using custom JavaScript code. To set a default value for a form field, you can utilize JavaScript to manipulate the field's value after the form is loaded. Here's an example of how you can accomplish this:
Add an HTML class or ID to the form field you want to set a default value for. For example, let's say the class is "default-value-field".
In your FusionAuth theme or custom HTML file, add a script tag that runs after the form has loaded:
html
<script>
document.addEventListener("DOMContentLoaded", function() {
// Find the form field by class or ID
var defaultField = document.querySelector(".default-value-field");
// Set the default value
defaultField.value = "Your default value";
});
</script>
This script listens for the "DOMContentLoaded" event, which occurs when the page is fully loaded. It then selects the form field using the class or ID you specified and sets its value to the desired default value.