1

please help me. I've got custom New event formular and I need arrange fields in it. I need move choice field "Termin od" beside Date&Time field named "Čas začatia", moreover how can I hide name of this choice field "Termin od" without hiding choices? If I use jQuery, it hides the field completely (Name and choices).

Got anybody some ideas of css or jQuery?

enter image description here

Thank you

3 Answers 3

0

Considering that you are using Sharepoint list forms - Below Jquery code should move the choice field

Code for DispForm.aspx $("a[name='SPBookmark_Identifier']").closest("td").next("td").appendTo($("a[name='SPBookmark_Title']").closest("tr")); $("a[name='SPBookmark_Identifier']").closest("tr").hide();

  • Replace Identifier with the internal name of your Termin od field
  • Replace Title with the internal name of your Čas začatia field

Code for EditForm.aspx & NewForm.aspx

$(".ms-formtable").find("tr:nth-child(2) td:nth-child(2)").appendTo($(".ms-formtable").find("tr:nth-child(1)")[0]); $(".ms-formtable").find("tr:nth-child(2)").hide()
9
  • I'm sorry, but it doesn't work. Aug 16, 2016 at 10:56
  • Here is my code: <script> // wait for the window to load $(document).ready(function () { $("a[name='Term_x00ed_n_x0020_od']").closest("td").next("td").appendTo($("a[name='EventDate']").closest("tr")); $("a[name='Term_x00ed_n_x0020_od']").closest("tr").hide(); }); </script> Aug 16, 2016 at 10:56
  • you need to use SPBookmark_YOURINTERNALCOLNAME in your Jquery selector. Such as SPBookmark_EventDate and SPBookmark_Term_x00e‌​d_n_x0020_od
    – HarryB
    Aug 16, 2016 at 11:01
  • I used this option too, but there's no effect. Here is code: <script> // wait for the window to load $(document).ready(function () { $("a[name='SPBookmark_Term_x00ed_n_x0020_od']").closest("td").next("td").appendTo($("a[name='SPBookmark_EventDate']").closest("tr")); $("a[name='SPBookmark_Term_x00ed_n_x0020_od']").closest("tr").hide(); }); </script> Aug 16, 2016 at 11:11
  • sorry my mistake! this code will work on the display form. I have added code for the Edit form to my answer which you can use as a reference.
    – HarryB
    Aug 16, 2016 at 11:24
0

Create new list form by using Sharepoint Designer and edit form html without using additional scripts and styles.

0

Here is solution code:

<script language="javascript" src="https://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/SiteAssets/code/jquery-3.0.0.min.js"></script> <script> $(document).ready(function () { $(".ms-formtable").find("tr:nth-child(4) td:nth-child(2)").appendTo($(".ms-formtable").find("tr:nth-child(1) td:nth-child(3)")[0]); $(".ms-formtable").find("tr:nth-child(6) td:nth-child(2)").appendTo($(".ms-formtable").find("tr:nth-child(1) td:nth-child(3)")[1]); $(".ms-formtable").find("tr:nth-child(4) td:nth-child(1)").hide(); $(".ms-formtable").find("tr:nth-child(6) td:nth-child(1)").hide(); }); </script>

Thanks a lot to HarryB.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.