1. Fabrik 3.9 has been released. If you have updated Joomla to 3.9, this is a required update.
    Dismiss Notice
  2. If you update to Joomla 3.9.16, you will have to update Fabrik from the latest GitHub version, to fix a bug introduced in Joomla, which makes it impossible to list front end folder locations in backend JForms. This affects things like template selection.
    Dismiss Notice

Form plugin / conversion of form to JSON

Discussion in 'Community' started by smalldragoon, Mar 26, 2020 at 8:45 PM.

  1. smalldragoon

    smalldragoon Member

    Level: Community
    Hi,
    I would need to convert/translate the form I'm submitting to JSON ( to send it to something else )
    Is there a way to do this ? I searched into the form plugins but nothing related I think
    Thanks for your insights
    Lionel
     
  2. troester

    troester Well-Known Member Staff Member

    Level: Community
    You can do whatever you want with a php plugin.
     
  3. smalldragoon

    smalldragoon Member

    Level: Community
    yes, it was to check if I was not missing something and the job was not done already....
    it happens that finally, I need it in Javascript before the submission,
    here is below some code for benefits of the forum if it can help someone !
    thanks


    var params = '{';
    for( var i=0; i<document.form_1.elements.length; i++ )
    {
    var fieldName = document.form_1.elements.name;
    var fieldValue = document.form_1.elements.value;

    params += '"' +fieldName + '":"' + fieldValue + '",';
    }
    params = params + '}';


    where form_1 is the name of your form....
     
    juuser likes this.

Share This Page