Jump to content
Graham Quince

Auto-populating a form

Recommended Posts

Forms and HTML widgets load into pages at different times, so while it might be possible to use an HTML widget to fill in a form, it was never advisable.... but I  had a bit of a brain wave, what if there was an auto-populate button?

<btn class="btn update">Update</btn>
<script>
var formUUID = "A177324620028A7AE4656F9A366E1506E020CAEC0FD54E71";
$(".update").click(function(){
  $('div[data-content-uuid="'+formUUID+'"]').find('#A1773C3F2003F19E97E1FF73A16D15075DA8D53C48F8AF59').val("Does this work");
});
</script>

This code targets the form, then the specific field.  You could add multiple fields within the function and have a big chunk of the form get filled out for you.  You could use a div superimposed above the form with the button on, so that users are forced to click it before they begin filling out the rest.  

There's a lot to unpack here, but as a hack/workaround I think its got potential.

  • Like 1
Link to post
Share on other sites
22 hours ago, Graham Quince said:

Forms and HTML widgets load into pages at different times, so while it might be possible to use an HTML widget to fill in a form, it was never advisable.... but I  had a bit of a brain wave, what if there was an auto-populate button?


<btn class="btn update">Update</btn>
<script>
var formUUID = "A177324620028A7AE4656F9A366E1506E020CAEC0FD54E71";
$(".update").click(function(){
  $('div[data-content-uuid="'+formUUID+'"]').find('#A1773C3F2003F19E97E1FF73A16D15075DA8D53C48F8AF59').val("Does this work");
});
</script>

This code targets the form, then the specific field.  You could add multiple fields within the function and have a big chunk of the form get filled out for you.  You could use a div superimposed above the form with the button on, so that users are forced to click it before they begin filling out the rest.  

There's a lot to unpack here, but as a hack/workaround I think its got potential.

Obviously well above my understanding of code.....  but nice idea!! 🤪

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...