I have this field in one form:
<input type="text" name="promocode" id="promoCode" value="" style="width:24%" maxlength="5">
and this field in another form:
<input type="hidden" name="custom" class="promo" value="" />
How can I do, so whenever the value of #promoCode is changed, it will also change the value of .promo
Currenlty, I have this:
var promo = $("#promoCode").val();
$("#promoCode").change(function(){
$('.promo').val(promo);
});
But that doesn't work.
#echoshould be.promoorinput[name="custom"].#echo?$('#echo').val(promo);before editting .