⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

How do I disable my multiselect box?



clustersblue
  • profile picture
  • Member

Posted 12 November 2012 - 08:34 AM


<div id="session_id_field_box" class="form-field-box odd">
<div id="session_id_display_as_box" class="form-display-as-box"> Session ID : </div>
<div id="session_id_input_box" class="form-input-box">
<select id="field-session_id" class="chosen-multiple-select chzn-done" style="width: 510px; display: none;" data-placeholder="Select Session ID" size="8" multiple="multiple" name="session_id[]">
<div id="field-session_id_chzn" class="chzn-container chzn-container-multi" style="width: 510px;">
<ul class="chzn-choices">
<div class="chzn-drop" style="left: -9000px; width: 508px; top: 32px;">
</div>
</div>
<div class="clear"></div>
</div>


[attachment=349:session.JPG]

Hi,

Above are examples of my code and the display respectively. I would like to disable the multiselect field of Session ID so that users will not be able to modify what is being displayed. I already tried these scripts but to no avail:



$('#session_id_input_box').prop("disabled",true);

and

$('#session_id_input_box').attr("disabled");



Can this be implemented in GC without using external jquery?

Thanks and BR,
clustersblue

clustersblue
  • profile picture
  • Member

Posted 12 November 2012 - 08:45 AM

I also tried using


->callback_edit_field('session_id',array($this,'_session_id_edit_field'))


to be able to change the format of this field from a multi-select box to just plain list. I was able to do that successfully but the problem I encountered was when I update the data and since I'm using set_relation_n_n the data from the relation table gets deleted. Probably because when I change the field using callback_edit_field it will not return the session POST data back to the system and it is thinking that the data was been removed from the list.

If I can bring back the session data to the POST during edit I might be using this one instead of disabling the multiselect field.

Thanks and BR,
clustersblue

victor
  • profile picture
  • Member

Posted 12 November 2012 - 09:52 AM

Hi! You can use a multiple select as a hidden object. And you can show the list of sessions as any text.

clustersblue
  • profile picture
  • Member

Posted 12 November 2012 - 10:25 AM

Victor,

If I couldn't get the that field disabled, I think I'll go for your suggestion. I'll let you know what I will come up then.

Thanks and BR,
clustersblue

clustersblue
  • profile picture
  • Member

Posted 23 November 2012 - 05:10 AM

In the end I followed Victor's advise.