-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.js
39 lines (33 loc) · 991 Bytes
/
functions.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
$(function () {
$('input[type=radio]').click(function () {
var type = $(this).val(),
content;
// Hide all content fields
$('.type-detail').hide();
// Clear all content fields
$('.type-detail').find('input').val('');
$('.type-detail').find('textarea').val('');
// Show content fields for type selected
$('#'+type).show();
});
$('#qr-form').submit(function () {
var datastring = {
url : $('input[name=url]').val(),
text_content : $('textarea[name=text_content]').val(),
telephone_number : $('input[name=telephone_number]').val(),
sms_telephone_number : $('input[name=sms_telephone_number]').val(),
sms_text_content : $('textarea[name=sms_text_content]').val(),
size : $('#size').val()
}
$.ajax({
url: "http://www.box-head.co.uk/apps/qr/generate-qr.php",
data: datastring,
type: 'post',
success: function (data) {
$('#qr-image').attr('src', data);
$('#qr-code').show();
}
});
return false;
});
});