diff options
| author | George Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2023-06-01 03:33:18 +0300 |
|---|---|---|
| committer | George Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2023-06-01 03:33:18 +0300 |
| commit | 864fbb806621c8167c49f7449486fbc3bdaca1a6 (patch) | |
| tree | 1b5b5933dbb184b130c248d3281e709bd6286c5d /public/app/views/js/submit/update-properties.php | |
| parent | 950798a91c0bed3f2d6e53182b0cff49f07eff0c (diff) | |
| download | gyraf1gov-864fbb806621c8167c49f7449486fbc3bdaca1a6.tar.gz gyraf1gov-864fbb806621c8167c49f7449486fbc3bdaca1a6.tar.bz2 gyraf1gov-864fbb806621c8167c49f7449486fbc3bdaca1a6.zip | |
user update; user petitions copy; fixed docker performance issues
Diffstat (limited to 'public/app/views/js/submit/update-properties.php')
| -rw-r--r-- | public/app/views/js/submit/update-properties.php | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/public/app/views/js/submit/update-properties.php b/public/app/views/js/submit/update-properties.php new file mode 100644 index 0000000..651ef3e --- /dev/null +++ b/public/app/views/js/submit/update-properties.php @@ -0,0 +1,38 @@ +<script> + $(document).ready(function() { + + // When form is submited + //////////////////////////////////////////////////////////////////////////// + + $('form').submit( event => { + event.preventDefault(); + + // prepare data to POST + var data = { + // identification fields + id: $('input[name=id]').val(), + // data fields + first_name: $('input[name=first_name]').val(), + last_name: $('input[name=last_name]').val(), + father_name: $('input[name=father_name]').val(), + email: $('input[name=email]').val(), + registration_number: $('input[name=registration_number]').val(), + sector: $('select[name=sector]').select2('data')[0].text, + belonging_school: $('input[name=belonging_school]').val(), + position: $('select[name=position]').select2('data')[0].text, + phone: $('input[name=phone]').val(), + }; + console.log(data); + + var request = '/user/update_properties'; // set action url + + // send POST request + $.post(request, data) + .done(function( data ) { + $('.office .content-form').html(`<h4>${data.title}<h4><br>${data.message}`) + }); + + }); + + }); +</script>
\ No newline at end of file |
