L
lawrence
I'm getting errors on my page, even with a lot of this function
commented out. Can anyone tell me what I'm doing wrong? I'm new to
Javascript (though I know a fair about of Java and PHP) and I'm
wondering what mistake I'm making.
is this:
document.forms.pdsForm.imagesToInsert.value
the correct way to get a value using items ids? The id names are
correct (pdsForm.imagesToInsert), one for the form and the second for
the textarea that I want to get.
function insertAtCursor(myField) {
var imageName = '';
var path = '';
var myValue = '';
var status = '';
imageName = document.forms.pdsForm.imagesToInsert.value;
alert(imageName);
window.status= imageName;
path = '$path';
myValue = path+imageName;
status = myValue + ' - ' + myField;
window.status= status;
// document.forms.pdsForm.inputId3.value += myValue;
//document.forms['form'].elements['field']
// //IE support
// if (document.selection) {
// myField.focus();
// sel = document.selection.createRange();
// sel.text = myValue;
// } else if (myField.selectionStart || myField.selectionStart ==
'0') {
// //MOZILLA/NETSCAPE support
// var startPos = myField.selectionStart;
// var endPos = myField.selectionEnd;
// myField.value = myField.value.substring(0, startPos) + myValue +
myField.value.substring(endPos, myField.value.length);
// } else {
// myField.value += myValue;
// }
}
commented out. Can anyone tell me what I'm doing wrong? I'm new to
Javascript (though I know a fair about of Java and PHP) and I'm
wondering what mistake I'm making.
is this:
document.forms.pdsForm.imagesToInsert.value
the correct way to get a value using items ids? The id names are
correct (pdsForm.imagesToInsert), one for the form and the second for
the textarea that I want to get.
function insertAtCursor(myField) {
var imageName = '';
var path = '';
var myValue = '';
var status = '';
imageName = document.forms.pdsForm.imagesToInsert.value;
alert(imageName);
window.status= imageName;
path = '$path';
myValue = path+imageName;
status = myValue + ' - ' + myField;
window.status= status;
// document.forms.pdsForm.inputId3.value += myValue;
//document.forms['form'].elements['field']
// //IE support
// if (document.selection) {
// myField.focus();
// sel = document.selection.createRange();
// sel.text = myValue;
// } else if (myField.selectionStart || myField.selectionStart ==
'0') {
// //MOZILLA/NETSCAPE support
// var startPos = myField.selectionStart;
// var endPos = myField.selectionEnd;
// myField.value = myField.value.substring(0, startPos) + myValue +
myField.value.substring(endPos, myField.value.length);
// } else {
// myField.value += myValue;
// }
}