Display of an image on a form

I asked this years ago, perhaps something has changed?
When I display an image on a form, it displays “Select” and a DELETE check box. How to I disable that display?

Screenshot 2025-02-19 at 9.47.03 PM

You tried use a macro for disable a field? o check it read only?

Nope, neither of those worked

https://forum.scriptcase.net/t/solved-image-field-hide-select-file-button-and-delete/28317

Doesnt work for me.
Any ideas?

Lewis



Try .style.display=“none”;

Still no. Am I dong something wrong?

I appreciate your helping me on this

Hi,

Try it with jQuery

$('.chk_ajax_img_invphoto').hide();
$('.sc-id-upload-select-invphoto').hide();

Are you typing ById with Capital i? It’s seams that you are using L

getElementById

1 Like

I was. I also had dashes in line 2, rather than underscore. Yet it still does not work.

I have it in OnLoad Javascript

frustrating!

Thank you again for your time

getElementById is case sensitive as far as I now use it this way getElementById

I have checked many syntax sites and think I now have it correct.
I found this sample on W3 and it works perfectly hide a field… I have a screen capture

Does it require any code before or after the statements?


It looks ok, It’s working for me.
No it does not require any aditional code.
If the quotes are ok and it’s not working yo can try with:
.style.display=“none”;
or the jlboutin60 JQuery solution.
You can try in another Browser.
Good luck!

Nope, nothing. I will give it a rest and come back to it. I may just be blind to it now
TY again

You need to format it the right way

?>
<script TYPE="text/javascript">
     document.getElementByID("chk_ajax_img_infPhoto").style.visibility = "hidden";
     document.getElementByID("sc-id-upload-select-invPhoto").style.visibility = "hidden";
</script>
<?php

Hi @jlboutin60 As far as I know, If he uses Javascript + onForm, is pure JS

image

image

You are right, I thought it was in onLoad Event

Personnaly I would put this code in onScriptInit

Try using _invphoto as we can see here:

TY gentlemen
None of that works.
I found on W3 there is a test page, where it did work as follows

const myElement = document.getElementById(“chk_ajax_img_invphoto”);
myElement.style.display = “none”;

but not in my app.

I tried onScriptinit
JS onLoad

Nothing

TY for trying to

Lewis