Focus on text field after load form - Chronoforms V6

Set focus on a specific text field after a ChronoForms V6 form loads.

Overview

The issue is that the JavaScript method used in earlier CF versions is not directly compatible with CF V6.
Use a custom code action to execute a script that targets the field by its ID to apply focus upon form load.

Answered
ChronoForms v6
ro rotocal 26 Jun, 2017
Hi everyone,
Does anyone know how to set focus on a field after form load in Chronoforms version 6.
I used in the past for CF V5 following:

<script>
document.forms['form_name'].myfield.focus();
</script>

inside a "Custom Code" section after loading the form.
Max_admin Max_admin 27 Jun, 2017
Answer
Hi rotocal,

please try the following code:

<script>
document.getElementById("field_id").focus();
</script>


Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.