Modifying user input before using cURL pluging

henrikadolfsson 05 Nov, 2010
Hi,

I'm trying to modify the user's input before sending the data to an external server using the cURL plugin, but I don't understand how to do it. I have set-up the cURL plugin with addresses and such, but I don't succeed in modifying the value.

I have created a form with an input field 'number' and I would like to add international prefix to it before posting it to an external server.
User input: 0701234567
Modified value: 0046701234567
Where and how do I do this? Please, include example.

Thanks in advance
/Henrik

Ps. Thanks for Chronoforms, really excellent!
GreyHead 05 Nov, 2010
Hi Henrik,

You can change it using PHP in the Plug-in Extra before cURL code box
<?php
$number = JRequest::getString('input_name', '', 'post');
if ( $number ) {
  $number = '004'.substring($number, 1);
}
JRequest::setVar('input_name', $number);
?>

Bob
Whoop 19 Nov, 2010
Hi Bob,

Thanks for the valuable hint. Unfortunately, I do not understand where exactly I can find "Plug-in Extra before cURL code box"?

Do you mean "Extra Code" area on the "Form Code" tab by that?

Would be great if you could give a more precise explanation where to find that box.

Many thanks for your helpful support.

Oliver
GreyHead 19 Nov, 2010
Hi Oliver,

When you open the Plug-in Configuration there is an 'Extra code' tab; use the "Extra before CURL code" box there.

Bob
This topic is locked and no more replies can be posted.