Forums

How to Edit a hidden value from the form from the on submit

dfletcher 03 Apr, 2009
I have a form that has an element like this :
<input type="hidden" name="companyIDNumber" value="" >

In :
On Submit code - before sending email:
I have a line of php I want to set the value of the companyIDNumber. I've tried :
JRequest::setVar('companyIDNumber', $returnArray['companyIDNum']);

as well as
$_POST['companyIDNumber'] = $returnArray['companyIDNum'];


So it seams to me that the data structre that the email is pulling from isn't either of those, but I can't figure out what it is.

Thanks in advance.

Don Fletcher

BTW -- I'm using version 2.5 J1.5 RC3.1
GreyHead 03 Apr, 2009
Hi Don,

Where does the value of companyIDNumber come from - in the form it's set with value="" ??

Bob
dfletcher 03 Apr, 2009
the Onsubmit generates the value.

		$returnArray = createCompany($industryIDNum, $formdata);
		JRequest::setVar('companyIDNumber', $returnArray['companyIDNum']);
GreyHead 04 Apr, 2009
Hi Don,

Ok, by the time the OnSubmit Before code runs the {field_name} substitution has already been done. So far the workaround for that has been to add a place marker in the email template and use strreplace() in the OnSubmit Before box to substitute the new value.

Bob
Max_admin 04 Apr, 2009
Hi Don,

you may try that with V3.1 RC4, as the email template will be generated after the onsubmit code has run completely! if you set a post variable then it will appear in the email!

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.