Patch #705899 from Alexis Soulard

This commit is contained in:
Garvin Hicking
2003-04-06 19:14:36 +00:00
parent 0d39fbcb3f
commit 6d7e4ed82d
3 changed files with 71 additions and 26 deletions

View File

@@ -636,9 +636,49 @@ function onKeyDownArrowsHandler(e) {
e.returnValue = false;
}
/**
* Inserts multiple fields.
*
*/
function insertValueQuery() {
var myQuery = document.sqlform.sql_query;
var myListBox = document.sqlform.dummy;
if(myListBox.options.length > 0) {
var chaineAj = "";
var NbSelect = 0;
for(var i=0; i<myListBox.options.length; i++) {
if (myListBox.options[i].selected){
NbSelect++;
if (NbSelect > 1)
chaineAj += ", ";
chaineAj += myListBox.options[i].value;
}
}
//IE support
if (document.selection) {
myQuery.focus();
sel = document.selection.createRange();
sel.text = chaineAj;
document.sqlform.insert.focus();
}
//MOZILLA/NETSCAPE support
else if (document.sqlform.sql_query.selectionStart || document.sqlform.sql_query.selectionStart == "0") {
var startPos = document.sqlform.sql_query.selectionStart;
var endPos = document.sqlform.sql_query.selectionEnd;
var chaineSql = document.sqlform.sql_query.value;
myQuery.value = chaineSql.substring(0, startPos) + chaineAj + chaineSql.substring(endPos, chaineSql.length);
} else {
myQuery.value += chaineAj;
}
}
}
/**
* listbox redirection
*/
function goToUrl(selObj, goToLocation){
eval("document.location.href = '" + goToLocation + "pos=" + selObj.options[selObj.selectedIndex].value + "'");
eval("document.location.href = '" + goToLocation + "pos=" + selObj.options[selObj.selectedIndex].value + "'");
}