• Home
  • Blog
  • Documentation
  • FAQ
    • Pre-Sales Questions
  • Log In
  • Get Easy Forms
  • Home
  • Blog
  • Documentation
  • FAQ
    • Pre-Sales Questions
  • Log In
  • Get Easy Forms
home/Knowledge Base/Advanced Techniques/Auto-Fill a Form Using the Form Widget
Popular Search:Getting Started

Auto-Fill a Form Using the Form Widget

908 views 6 January 1, 2019 Updated on October 1, 2020 admin

To set the Default Values, copy & paste the Form embed code and find the line with the key: ‘height‘. Below this line add the next code to populate a text field with the ID: ‘text_0’.

'defaultValues': {
    'text_0': 'This is my default value'
}

Note: You can find the field ID in Form Builder -> Code tab.

See the example below to understand how to set the Default Values object.

var s = d.createElement(t), options = {
  'id': 1,
  'container': 'c1',
  'height': '500px',
  'defaultValues': {
    'text_0': 'This is my default value',
    'checkbox_0': true,
    'select_0': 'Second Option'
  }
  'form': '//example.com/app/embed'
};

How to pass PHP variables to the Form Widget

For this tip, you need to add an embed code to a PHP webpage, then you need to customize the embed code to add the defaultValues object and print the PHP variables. Eg.

'defaultValues': {
    'text_0': '<?= $_GET['lname'] ?>'
}

Was this helpful?

6 Yes  2 No
Related Articles
  • Compare Date fields: How to ensure that Finish Date is at least equal to *or after* Start Date, and *not* before?
  • How to embed a Form using iFrame code
  • Dynamic Content: Conditional Logic with Dates
  • Date Based Conditional Logic
  • Calculate Difference of Time between Two Time fields
  • Date Formats with Dynamic Content

Didn't find your answer? Contact Us

Advanced Techniques
  • Auto-Fill a Form Using the Form Widget
  • Compare Date fields: How to ensure that Finish Date is at least equal to *or after* Start Date, and *not* before?
  • How to embed a Form using iFrame code
  • Dynamic Content: Conditional Logic with Dates
  • Date Based Conditional Logic
  • Calculate Difference of Time between Two Time fields
View All 21  
Popular Articles
  • How to Show/Hide HTML elements with Conditional Rules
  • How to enable / disable DEBUG mode
  • How to Submit a Form as WhatsApp Message
  • How to update Form Stats from the command line
  • How to compare two fields to pass the validation (jQuery Validation)
KB Categories
  • Add-Ons
  • Advanced Techniques
  • Common Issues & Troubleshooting
  • Developers "How To's"
  • Getting Started
  • How To

  Calculate Difference of Time between Two Time fields

About Easy Forms

With Easy Forms you can create unlimited web forms and most importantly the complete management of them without paying monthly fees

Resources
  • Knowledge Base
  • Documentation
  • Pre-sales Questions
  • Blog
Useful Help Links
  • Get Easy Forms
  • Live Demo
  • License Terms
  • Contact Us
Frequent Visit Links
  • Pre-Sales Questions
  • System Requirements
  • Installing Easy Forms
  • Upgrading Easy Forms
  • Privacy Policy
  • © 2015 - 2024 Baluart EIRL. All Rights Reserved.

Popular Search:Getting Started