Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End How to display form value even if there’s an error during submission?

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #36097
    jacorre
    Participant

    Hello,

    I have fields set as required so that if the form is submitted and those fields are not defined, an error displays.

    Unfortunately, any field values that were entered do not redisplay so the user would have to enter them again.

    I was able to use the following to get simple fields displaying the value:

    value=""

    But here’s where I run into an issue. How would I get it to work for an array field that has a name like:

    name="ingredient[][amount]"

    The variable $i will be a number that corresponds to the number of the entry. So if 3 ingredient amounts were entered it would be:


    name="ingredient[0][amount]"
    name="ingredient[1][amount]"
    name="ingredient[2][amount]"
Viewing 1 post (of 1 total)
  • The forum ‘Back End’ is closed to new topics and replies.