Problems, need help? Have a tip or advice? Post it here.
4 posts Page 1 of 1
Hi

I'm using a cms:input tag in some javascript code.
Code: Select all
$('#listExtra').append('<cms:input name="extra" type="text" value=" '+inputExtra.name+' " />');    


As you can see I'm calling a variable into the value section of the cms:input.
The problem is that everything between "" quotes is exactly showed as it stands in the code.
For example: if the variable 'inputExtra' has a value of 'SomeInfo', the input field on the website has a value of inputExtra in stead of SomeInfo.

If I'm doing this whit an inputfield without cms: tag, it works fine, the actual value of the variable is shown.

Do you guys have some experience with this?

thanks!
Sam, all <cms:... /> tags are processed server-side.
You are trying to add one such tag on the client-side - this will yield nothing as there is no server at that point to process it.

That said, could you please explain in detail as to what you are trying to achieve?
Perhaps we can find the right solution.
Ofcourse, I see the issue with my workmethod know (server/client-side wise). :-)

What I want to achieve is to get some values I calculated with Javascript into a mail.
But as you said, Couch is working serverside, so I'm gonna work out an other solution.
You can't use JavaScript to create a Couch tag, but maybe you could use it to create an ordinary input tag, then coax Couch into sending that value in an email upon processing the form. Something like
Code: Select all
$('#listExtra').append('<input name="extra" type="text" value=" '+inputExtra.name+' " />');

together with
Code: Select all
<cms:hide>
    <cms:input name='extra' type='text'/>
</cms:hide>

Kind of like @cheesypoof did here: viewtopic.php?p=13095#p13095

Or if the input field already existed in your form, you could append to the value instead of appending the whole tag.
4 posts Page 1 of 1
cron