Jump to content
Larry Ullman's Book Forums

Recommended Posts

Hi all,

I have a form with an array for error messages. If there is a problem the error messages appear at the top of the page. I would like to place them halfway down the page.

 

I'm using the following piece of code to display the errors:

 

else
{
foreach ($registration_error_messages as $reg_error)
{
echo "$reg_error";
}
}

 

In order to do this would I need to assign the $reg_error to another array and then use printr to display this array wherever I want? Or is there a better way?

 

Cheers

Paul

Link to comment
Share on other sites

Margaux,

Thanks for the answer and sorry for the slow response, I got sidetracked for a while.

 

Your suggestion worked great. I used CSS to absolute position the div whereever I wanted. The only slight change I made (for anyone who's interested) is that I wrapped the whole lot in a div, including the foreach bit, otherwise if there was more than 1 error they just sat on top of one another as opposed to a list.

 

Cheers

Paul

  • Upvote 1
Link to comment
Share on other sites

 Share

×
×
  • Create New...