Questions about Payment Form extension

How to dynamically fill a custom field

  • Azhar Abbas
  • Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 7 months ago #101334 by Azhar Abbas
How to dynamically fill a custom field was created by Azhar Abbas
Dear Admin
Please suggest how to fill the fields like textbox, combo box using session variable or dynamic data.
In short i will tell you my requirements - I am having article id in session variable based on that id i have to collect the data like Title, Package available for that id and rate based on the package. and these data should be prefilled in fields of the forms.

Waiting for an early reply.
Regards
Azhar Abbas

Please Log in or Create an account to join the conversation.

  • Tuan Pham Ngoc
  • Away
  • Administrator
  • Administrator
More
7 years 7 months ago #101370 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic How to dynamically fill a custom field
Hi Azhar

Right now, the only way is editing the code. You will need to look at the file components/com_pmform/View/Form/Html.php. You will see that there is a variable called $data. That variable is an array store the values which will be used to fill-in form field in key => value format

So if you want to prefill value for a field called name_of_field for example, then using the code like this

$data = 'The value you want';'

After that, that field will be pre-filled by the value you set in $data array

Regards,

Tuan

Please Log in or Create an account to join the conversation.

Moderators: Tuan Pham Ngoc