Skip to main content
edited body
Source Link
stckvrw
  • 891
  • 9
  • 24

As we know we can retrieve values of all the fields if they have names like name="jform[something]" and we can use the code:

$jinput = JFactory::getApplication()->input;
$formData = new JRegistry($jinput->get('jform', '', 'array'));

But is there some way to do the same if we have form with some name for example <form name="myForm"> and filedsfields with names like name="something" i.e. without jform[] ?

Thanks in advance

Joomla 3.5.1

As we know we can retrieve values of all the fields if they have names like name="jform[something]" and we can use the code:

$jinput = JFactory::getApplication()->input;
$formData = new JRegistry($jinput->get('jform', '', 'array'));

But is there some way to do the same if we have form with some name for example <form name="myForm"> and fileds with names like name="something" i.e. without jform[] ?

Thanks in advance

Joomla 3.5.1

As we know we can retrieve values of all the fields if they have names like name="jform[something]" and we can use the code:

$jinput = JFactory::getApplication()->input;
$formData = new JRegistry($jinput->get('jform', '', 'array'));

But is there some way to do the same if we have form with some name for example <form name="myForm"> and fields with names like name="something" i.e. without jform[] ?

Thanks in advance

Joomla 3.5.1

deleted 767 characters in body; edited title
Source Link
stckvrw
  • 891
  • 9
  • 24

How to getretrieve values of all the filled fields of entire form with JInput but without jform[]

IAs we know that we can get valueretrieve values of some specific field by usingall the fields if they have names like name="jform[something]" and we can use the code:

$input$jinput = JFactory::getApplication()->input;
$value$formData = $input->get('someName', '', 'post');

and set it as the body of letter by using:

$mailer =new JFactory::getMailer();
...
$mailer->setBodyJRegistry($value);

But if I have the form like:

<form name="myForm">
    <input type="radio" name="radioName" value="Value1">
    <input type="radio" name="radioName" value="Value2">
    <input type="radio" name="radioName" value="Value3">
    <input type="checkbox" name="checkboxName1" value="Value4">
    <input type="checkbox" name="checkboxName2" value="Value5">
    <input type="text" name="textName">
    <input type="submit" name="submitName" value="Send">
</form>

then how can I get values of all the filled fields of the form as an array?

I found the code:

$formData = $input$jinput->get('jform', '', 'array'));

It works if allBut is there some way to do the fieldssame if we have names likeform with some name for example name="jform[someName]"<form name="myForm"> and I get the resultfileds with names like

{"someName1":"someValue1","someName2":"someValue2"}

Can I achieve the same result but only using the name of my form name="something" i.e. name="myForm" without jfrom[]jform[]  ?

Thanks in advance

Joomla 3.5.1

How to get values of all the filled fields of entire form with JInput

I know that we can get value of some specific field by using:

$input = JFactory::getApplication()->input;
$value = $input->get('someName', '', 'post');

and set it as the body of letter by using:

$mailer = JFactory::getMailer();
...
$mailer->setBody($value);

But if I have the form like:

<form name="myForm">
    <input type="radio" name="radioName" value="Value1">
    <input type="radio" name="radioName" value="Value2">
    <input type="radio" name="radioName" value="Value3">
    <input type="checkbox" name="checkboxName1" value="Value4">
    <input type="checkbox" name="checkboxName2" value="Value5">
    <input type="text" name="textName">
    <input type="submit" name="submitName" value="Send">
</form>

then how can I get values of all the filled fields of the form as an array?

I found the code:

$formData = $input->get('jform', '', 'array');

It works if all the fields have names like name="jform[someName]" and I get the result like

{"someName1":"someValue1","someName2":"someValue2"}

Can I achieve the same result but only using the name of my form i.e. name="myForm" without jfrom[]?

Thanks in advance

Joomla 3.5.1

How to retrieve values of all the fields with JInput but without jform[]

As we know we can retrieve values of all the fields if they have names like name="jform[something]" and we can use the code:

$jinput = JFactory::getApplication()->input;
$formData = new JRegistry($jinput->get('jform', '', 'array'));

But is there some way to do the same if we have form with some name for example <form name="myForm"> and fileds with names like name="something" i.e. without jform[]  ?

Thanks in advance

Joomla 3.5.1

added 5 characters in body
Source Link
stckvrw
  • 891
  • 9
  • 24

I know that we can get value of some specific field by using:

$input = JFactory::getApplication()->input;
$value = $input->get('someName', '', 'post');

and set it as the body of letter by using:

$mailer = JFactory::getMailer();
...
$mailer->setBody($value);

But if I have the form like:

<form name="myForm">
    <input type="radio" name="radioName" value="Value1">
    <input type="radio" name="radioName" value="Value2">
    <input type="radio" name="radioName" value="Value3">
    <input type="checkbox" name="checkboxName1" value="Value4">
    <input type="checkbox" name="checkboxName2" value="Value5">
    <input type="text" name="textName">
    <input type="submit" name="submitName" value="Send">
</form>

then how can I get values of all the filled fields of the form as an array?

I found the code:

$formData = $input->get('jform', '', 'array');

It works if all the fields have names like name="jform[someName]" and I get the result like

{"someName1":"someValue1","someName2":"someValue2"}

Can I achieve the same result but only withusing the name of my form i.e. name="someName"name="myForm" without jfrom[]?

Thanks in advance

Joomla 3.5.1

I know that we can get value of some specific field by using:

$input = JFactory::getApplication()->input;
$value = $input->get('someName', '', 'post');

and set it as the body of letter by using:

$mailer = JFactory::getMailer();
...
$mailer->setBody($value);

But if I have the form like:

<form name="myForm">
    <input type="radio" name="radioName" value="Value1">
    <input type="radio" name="radioName" value="Value2">
    <input type="radio" name="radioName" value="Value3">
    <input type="checkbox" name="checkboxName1" value="Value4">
    <input type="checkbox" name="checkboxName2" value="Value5">
    <input type="text" name="textName">
    <input type="submit" name="submitName" value="Send">
</form>

then how can I get values of all the filled fields of the form as an array?

I found the code:

$formData = $input->get('jform', '', 'array');

It works if all the fields names like name="jform[someName]" and I get the result like

{"someName1":"someValue1","someName2":"someValue2"}

Can I achieve the same result but only with name="someName" without jfrom[]?

Thanks in advance

Joomla 3.5.1

I know that we can get value of some specific field by using:

$input = JFactory::getApplication()->input;
$value = $input->get('someName', '', 'post');

and set it as the body of letter by using:

$mailer = JFactory::getMailer();
...
$mailer->setBody($value);

But if I have the form like:

<form name="myForm">
    <input type="radio" name="radioName" value="Value1">
    <input type="radio" name="radioName" value="Value2">
    <input type="radio" name="radioName" value="Value3">
    <input type="checkbox" name="checkboxName1" value="Value4">
    <input type="checkbox" name="checkboxName2" value="Value5">
    <input type="text" name="textName">
    <input type="submit" name="submitName" value="Send">
</form>

then how can I get values of all the filled fields of the form as an array?

I found the code:

$formData = $input->get('jform', '', 'array');

It works if all the fields have names like name="jform[someName]" and I get the result like

{"someName1":"someValue1","someName2":"someValue2"}

Can I achieve the same result but only using the name of my form i.e. name="myForm" without jfrom[]?

Thanks in advance

Joomla 3.5.1

deleted 21 characters in body
Source Link
stckvrw
  • 891
  • 9
  • 24
Loading
edited body
Source Link
stckvrw
  • 891
  • 9
  • 24
Loading
Source Link
stckvrw
  • 891
  • 9
  • 24
Loading