# Hide field in table for the logged in user

**URL:** <https://forums.knack.com/t/hide-field-in-table-for-the-logged-in-user/6819>\
**Category:** Ask Developers\
**Created:** [February 14, 2019, 4:11pm UTC](https://forums.knack.com/t/hide-field-in-table-for-the-logged-in-user/6819 "2019-02-14T16:11:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nicholasmi75988](https://avatars.discourse-cdn.com/v4/letter/n/ce7236/32.png) [@nicholasmi75988](https://forums.knack.com/u/nicholasmi75988)\
**Post date:** [February 14, 2019, 4:11pm UTC](https://forums.knack.com/t/hide-field-in-table-for-the-logged-in-user/6819/1 "2019-02-14T16:11:17Z")

</div>

does anyone have an app example which could help me achieve the following:

Object : courses

Object: student

Each course has a link to a form to register

Students should only be able to register only once for each course, how could I disable /hide to registration form to avoid multiple registration by the same student?

---

<div class="post-metadata">

**Author:** ![nicholasmi75988](https://avatars.discourse-cdn.com/v4/letter/n/ce7236/32.png) [@nicholasmi75988](https://forums.knack.com/u/nicholasmi75988)\
**Post date:** [February 14, 2019, 8:35pm UTC](https://forums.knack.com/t/hide-field-in-table-for-the-logged-in-user/6819/2 "2019-02-14T20:35:45Z")

</div>

Indeed, way above my abilities , thanks anyway

---

<div class="post-metadata">

**Author:** ![JulianKirkness](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/juliankirkness/32/770_2.png) [@JulianKirkness](https://forums.knack.com/u/JulianKirkness)\
**Post date:** [February 14, 2019, 4:45pm UTC](https://forums.knack.com/t/hide-field-in-table-for-the-logged-in-user/6819/3 "2019-02-14T16:45:22Z")

</div>

I'm pretty sure you can't do this without Javascript - this code did something similar - for a booking onto an event it would warn the user if they had already booked onto it:

// add booking view 132

// account field 149

// event field 151

 

$(document).on('knack-view-render.view\_132', function (event, view, data) {

$('#' + view.key + '-field\_151').chosen().change(function() {

console.log('triggered');

 check\_duplicate();

});

 $('\<div class="kn-message error" id="duplicate\_alert"\>\</div\>')

 .insertAfter($('#kn-input-field\_151'))

 .hide();

 

function check\_duplicate () {

 var bookingFilters = [

 {

 'field':'field\_149',

 'operator':'is',

 'value':$('#'+ view.key + '-field\_149').val()

 },

 {

 'field':'field\_151',

 'operator':'is',

 'value':$('#'+ view.key + '-field\_151').val()

 } 

 ];

 var fullUrl = '[https://api.knack.com/v1/objects/object\_30/records?filters=](https://api.knack.com/v1/objects/object_30/records?filters=)' + encodeURIComponent(JSON.stringify(bookingFilters));

 Knack.showSpinner();

 $.ajax({

 url: fullUrl,

 async: false,

 type: 'GET',

 headers: {'X-Knack-Application-Id': '5ac608865b4eec1f69cacbdb', 'X-Knack-REST-API-Key': '16e94820-38c5-11e8-a291-33529755c0c2'}

 }).done(function(data) {

 // Make sure we have no duplicate records

 if (data.records.length !== 0) {

 Knack.hideSpinner();

 $('#duplicate\_alert').html($('\<p\>\<strong\>You had already booked onto that event - please select another! \</p\>\</strong\>')).show();

 $('#view\_132-field\_151').val([]).trigger('liszt:updated');

 }

 else

 {

 $('#duplicate\_alert').hide();

 Knack.hideSpinner();

 }

 }

)}

});

 

Horrendously complicated for something so simple but I hope it helps nonetheless!
