-
-
Notifications
You must be signed in to change notification settings - Fork 390
Expand file tree
/
Copy pathform.blade.php
More file actions
23 lines (19 loc) · 1.13 KB
/
form.blade.php
File metadata and controls
23 lines (19 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php use App\Models\Button; $button = Button::find($button_id); if(isset($button->name)){$buttonName = $button->name;}else{$buttonName = 0;} ?>
<select style="display:none" name="button" class="form-control"><option class="button button-default email" value="default xmpp">{{__('messages.Default XMPP')}}</option></select>
<label for='title' class='form-label'>{{__('messages.Custom Title')}}</label>
<input type='text' name='title' value='{{$title}}' class='form-control' />
<span class='small text-muted'>{{__('messages.Leave blank for default title')}}</span><br>
<label for='link' class='form-label'>{{__('messages.XMPP address')}}</label>
<input type='email' name='link' value='{{str_replace("xmpp:", "", $link)}}' class='form-control' required />
<span class='small text-muted'>{{__('messages.Enter your XMPP')}}</span>
<script>
$(document).ready(function() {
$('form').on('submit', function(e) {
var linkInput = $(this).find('input[name="link"]');
var linkValue = linkInput.val();
if (!linkValue.toLowerCase().startsWith('xmpp:')) {
linkInput.val('xmpp:' + linkValue);
}
});
});
</script>