Here’s the instructions for doing so in Notes; the same code will work in any form, just change the field’s ID attribute value (the "notes..." names) as appropriate. Notice that the onclick event for the button in the form will pass the id attribute value. In this case, it’s a composite ID attribute value, with the variable part generated by Notes, but in your case it will just be the field’s ID attribute value.
#########################################
# javascript for implementing resource browser for image
# upload/insertion in Jot/Notes forms.
# The SetUrl function must have the id attribute of the input field
# to hold the image url.
#########################################
function OpenServerBrowser(url, width, height ) {
var iLeft = (screen.width - width) / 2 ;
var iTop = (screen.height - height) / 2 ;
var sOptions = 'toolbar=no,status=no,resizable=yes,dependent=yes' ;
sOptions += ',width=' + width ;
sOptions += ',height=' + height ;
sOptions += ',left=' + iLeft ;
sOptions += ',top=' + iTop ;
var oWindow = window.open( url, 'FCKBrowseWindow', sOptions ) ;
}
function BrowseServer(notesId) {
window.notesId = notesId;
var w = screen.width * 0.7;
var h = screen.height * 0.7;
OpenServerBrowser('/manager/media/browser/mcpuk/browser.html?Type=images&Connector=/manager/media/browser/mcpuk/connectors/php/connector.php&ServerPath=/home1/westpos0/public_html/assets/', w, h);
}
function SetUrl(url, width, height, alt){
document.getElementById('wtImage'+window.notesId).value = url;
}
#############################################
# form field for uploading/inserting images in Jot/Notes form
# id attributed of the input field must match the parameter of the
# getElementbyId function in the javascript.
#############################################
<label for="wtImage[+notes.id+]">Image:<br />
<input tabindex="[+notes.seed:math=`?+6`+]" name="image" type="text" size="20" value="[+form.field.custom.image:esc+]" id="wtImage[+notes.id+]" /><input type="button" value="Select Image" onclick="BrowseServer('[+notes.id+]')" />
</label><br />
In the javascript, you’ll need to edit the line
OpenServerBrowser('/manager/media/browser/mcpuk/browser.html?Type=images&Connector=/manager/media/browser/mcpuk/connectors/php/connector.php&ServerPath=/FULL/PATH/TO/public_html/assets/', w, h);
so the paths are appropriate for your server.
Also pay extra attention to the function
function SetUrl(url, width, height, alt){
document.getElementById('wtImage'+window.notesId).value = url;
The getElementById needs to be the ID of the field in your form that will hold the selected image’s path.