Forums

Remove start and end curly brackets from input value?

berde,jitendra 11 Jan, 2012
Hi All,

We are using Chrono forms on our website. We have created single form and using it same form multiple times with assigning some variable into URL. We are placing URL variable values in a hidden input of forms. However for SEO purpose we have mentioned few keywords in one variable within {} brackets like below:
url?kiword={some word goes here}

While storing this value into hidden input. The value attribute get curly brackets like
<input type=hidden value="{some word goes here}">

I want to remove both curly brackets from value attributes. Can anybody let me know correct way to do it? I have tried trim and implode, explode but they seem not working.

Thanks in advance.

Regards,
Jitendra Berde
GreyHead 11 Jan, 2012
Hi berde,jitendra ,

I think preg_replace should do what you need.
<?php
preg_replace(array('{', '}'), '', $form->data['xxx']);
?>


Bob
berde,jitendra 11 Jan, 2012
Hi GreyHead,

Thank you for your reply.

The "kiword" variable mentioned into URL with some value inside curly bracket. Where should i mentioned your code?

Just want to remove both curly bracket before assign value to hidden input.

Hope you will understand my requirement.

Regards,
Jitendra Berde
GreyHead 11 Jan, 2012
Hi berde,jitendra,

It should go into a Custom Code action before the Show HTML action in the On Load event.

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