concatinate two strings in form?

Confluence User - 03 Sep, 2015

I have created a form having three fields firstname,secondname,fullname.In the 'test' named table.I would like to save the third field with adding the first & second fields by following hash variables given below

#form.test.firstname# #form.secondname.two#    

BUT it is saving the only hashvariables as like hashvariables  but not the values....Is there any method or configuration which need to do to achive the string concatination.......

forms;userviews

3


07 Sep, 2015
confluenceUser
confluenceUser

Hi there, 

You could try to use a JS inside a customHTML element to concatenate the field values.
This could be fired at the onchange method of the fields you want to concatenate or during the submit.

Let me know if this helps.

 

Thanks,

Ashutosh Tripathi

07 Sep, 2015
confluenceUser
confluenceUser

Hi Ashutosh Tripathi, May I know How to connect JS Concatenated inner form variables to pass another variable and to store as the full form variable as specified in the question,If you have any code samples please pass them. Thanks You In Advance.

08 Sep, 2015
confluenceUser
confluenceUser

Hi Sudarsan,

You could add a custom HTML form element in your form and add something like the following in it:

<script type='text/javascript'>
$(function(){
	$(document).on('change', 'input', function() {
		$('#fullname').val($('#firstname').val() + $('#secondname').val());
	});
});
</script>

Let me know if this works.

Thanks.

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print