0

I have a custom list where the value in the first column determines which other columns should have value. Or rather, the record type(as selected in the first column) defines what all data I should collect in the form.

I want to continue using the default/designer form for the list.

Is it possible to manipulate the form fields using JavaScript after identifying the value selected in the first column?

EDIT: When I create a new form, I am able to add javascript, and show/hide fields. However, I can't figure out how to read the fields in javascript.

2
  • Hi entryton, if you know a little of AngularJs, then you can use AngularForms to generate custom forms: github.com/Zerg00s/AngularForms Not a super-recommended approach, but at least, you don't need SharePoint Designer in this case. Oct 6, 2020 at 16:48
  • Hi Denis, my form has been in user for a long time, and I cannot move to AngularJs now.
    – entryton
    Oct 7, 2020 at 5:36

1 Answer 1

0

If you already have jQuery added to your page, fields can be accessed like so:

$("[title='INTERNAL_COLUMN_NAME']").value

enter image description here

For choice, date, lookup fields, etc. the code will be a little different. But this is the main idea.

If you need a special library that handles these complexities for you, you can use the good-old SPServices JavaScript library

Notes If, one day this form migrates to SharePoint Online, there is a very good chance that customizations will be lost.

Your Answer

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

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