1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
$('#sms-go').on('click',function(){ $('<input>').attr({ type: 'hidden', name: 'sms-yes', value: 'yes' }).appendTo('#form'); console.log('hidden yes added!'); }); $('#sms-no').on('click',function(){ $('<input>').attr({ type: 'hidden', name: 'sms-no', value: 'no' }).appendTo('#form'); console.log('hidden no added/yes removed!'); }); |
I used this little code with a reservation form… to put it simple… the user that wanted to make a reservation could opt in/out of receiving a confirmation SMS a few hours before the scheduled date/time…