Sorry if it is a newbie question, but does document.getElementbyId not work if the control's attribute is set to "hidden" (CRM form textfield with "visible by default= no")
I am trying to use a dummy field ("new_place_holder") as a reference point to insert a button (unsupported, I know). It is below a subgrid and rather than waiting and checking that the subgrid had properly loaded I thought a workaround would be to use a dummy field as a placeholder (knowing it would be accesible before the subgrid).
My code is:
var placetoinsert = document.getElementById('new_place_holder');
insertAfterField.parentElement.insertBefore(my_new_button, var placetoinsert);
This works when the field 'new_place_holder' is set to "visible" on the form, but as it is just a referencing anchor I do not want it to be visible. As soon as I set it to visible=no it does not work. If indeed document.getElementbyId does not work if the control's attribute is set to "hidden", is there any other function/way of referencing a field for this purpose, which might work when the field is invisible?
I hope this makes sense.
Many thanks,
- Seamus
*This post is locked for comments