anujgarg Posted March 9, 2010 Share Posted March 9, 2010 Hi, I am using a form in joomla that after submitting is being redirected to the same page containing form. I am also using server side validations into it. My problem is: when a server side validation occurs after submitting a form with a blank field, then I lose my form values that I filled before submitting the form. This is what I am using: $row->pkg_name = JRequest::getVar( 'pkg_name', '','post', 'string', JREQUEST_ALLOWRAW ); $row->int_desc = JRequest::getVar( 'internalDesc', '','post', 'string', JREQUEST_ALLOWRAW ); $row->ext_desc = JRequest::getVar( 'externalDesc', '','post', 'string', JREQUEST_ALLOWRAW ); if($row->pkg_name == "") $msg = "Package Name must have a value"; else if($row->price == "") $msg = "Price must have some value"; else if(!is_numeric($row->price)) $msg = "Price must have numeric value"; switch($show) { case '1': $msg = 'Package Modified'; break; case '0': $msg = 'Package could not be modified.'; break; default: } $this->setRedirect($link, $msg); The form is being redirected to the same page containing form but all values lost. How can I retain them? Please suggest... Thanks Anuj Quote Link to comment https://forums.phpfreaks.com/topic/194650-retain-values-in-form-after-redirect/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.