Regex inside javascript string

I have a form that needs to be implemented through javascript:

var birthdayForm = '<form id="birthday_signup" class="klaviyo_gdpr_embed_Wh3QTB" style="margin-top: 40px;" action="//manage.kmail-lists.com/subscriptions/subscribe" data-ajax-submit="//manage.kmail-lists.com/ajax/subscriptions/subscribe" method="GET" target="_blank" novalidate="novalidate">'+
'<input type="hidden" name="g" value="Wh3QTB">'+
'<input type="hidden" name="$fields" value="Birthday">'+
'<input type="hidden" type="text" name="Birthday" id="final_birthday">'+
'<div class="klaviyo_field_group">'+
'<h2>Vertel ons jouw verjaardag en we zorgen voor een leuke verrassing!</h2>'+
'<input class="" style="display:none;" type="email" value="" name="email" id="k_id_email" placeholder="Your email" />'+
'<div class="klaviyo_field_group klaviyo_form_actions">'+
'<div class="klaviyo_field_group" style="margin: 10px 0;">'+
'<input id="klaviyo_form_Birthday" oninput="this.value = this.value.replace(/[^0-9/.]/g, '').replace(/(..*)./g, '$1');" placeholder="dd/mm/yyyy" maxlength="10" type="text" />'+
'<button type="submit" class="klaviyo_submit_button btn" style="margin-left: 15px;">Versturen</button>'+
'</div>'+
'</div>'+
'</div>'+
'<div class="klaviyo_messages">'+
'<div class="success_message" style="display:none;">'+
'<p class="thank_you">Bedankt om jouw verjaardag te delen!</p>'+
'</div>'+
'<div class="error_message" style="display:none;"></div>'+
'</div>'+
'<div class="klaviyo_form_actions" style="margin: 10px 0;">'+
''+
'</div>'+
'</form>';

As you can see, the following regex is beig executed on “oninput”:

oninput="this.value = this.value.replace(/[^0-9/.]/g, '').replace(/(..*)./g, '$1');"

Unfortunately, this breaks. It’s probably not being escaped correctly. I fail to see how exactly though. Can anyone help me?