I want to add normal text and a jQuery value to an input value.
var amount = $(\'option:selected\', this).val();
$(\'.customfield\').val(\'clicks,
Try this
var amount = $('option:selected').val();
$('.customfield').val('clicks, <?php echo $userdata["id"] ?>,'+amount+');
Try this:
$('.customfield').val('clicks,<?php echo $userdata["id"] ?>,' + amount);
//--------double quote to id as is open and ---------^^^^
// closed by single quote and remove last +
var amount = $('option:selected').val();
$('.customfield').val('clicks,<?php echo $userdata['id'] ?>,' + amount);
var amount = $('option:selected').val(); // or var amount = $('#selectDropwdownId').val();
$('.customfield').val("clicks,<?php echo $userdata['id'] ?>," + amount );