<script>
function insertAtCursor(selectId, selectValue) {
if (document.selection) {
selectId.focus();
sel = document.selection.createRange();
sel.text = selectValue;
}
else if (selectId.selectionStart|| selectId.selectionStart == "0") {
var startPos = selectId.selectionStart;
var endPos = selectId.selectionEnd;
selectId.value = selectId.value.substring(0, startPos)
+ selectValue
+ selectId.value.substring(endPos, selectId.value.length);
} else {
selectId.value += selectValue;
}
}
// calling the function
//insertAtCursor(document.formName.fieldName, 'this value');
</script>
<form>
<textarea 'demo'),"1234") value=1 'demo'),"1234") value=2 "color" size="1">
<option value="Black" >Black</option>
<option value="Red" >Red</option>
<option value="Yellow" >Yellow</option>
<option value="Pink" >Pink</option>
<option value="Green" >Green</option>
<option value="Orange" >Orange</option>
<option value="Purple" >Purple</option>
<option value="Blue" >Blue</option>
<option value="Beige" >Beige</option>
<option value="Brown" >Brown</option>
<option value="Teal" >Teal</option>
<option value="Navy" >Navy</option>
<option value="Maroon" >Maroon</option>
<option value="LimeGreen" >LimeGreen</option></select> Smilar Posts of Color Picker js_select
-
AJAX cascading drop-down menu related drop-down lists
Q & A at xu_ch see ask a question about the drop-down list. Think of, made a before about using AJAX, dynamic update cascade similar pull-down menu function. To take this opportunity to organize t ...
-
JavaScript and jsp secondary structure linked the drop-down box without refresh
Meeting (2005-10-25) finishing This article does not use Ajax technology, the use of a single deposit of JavaScript + Jsp + DHTML to achieve Paragraph keyword database table ID SuperID relations Selec ...
-
js to obtain the drop-down list to select the value and text (select), as well as access to radio buttons (radio) group and modify the selected value of
First, access the drop-down list to select the value and text (select) Second, access to radio buttons (radio) group and modify the selected value of To see a lot of posts said js access the radio but ...
-
jQuery / Ajax / PHP / Json example of an integrated collection
jQuery excellent Javascript is a framework for a good js packaging, provides a lot of convenient features. jQuery for ajax packaging can be called outstanding. jQuery can json file transfer protocol t ...
-
javascript form
javascript form
-
Rails use of select
Assumptions have the following drop-down list box In the rails in the implementation of such a list box, you can use the following method 1) The use of select 2) Use select_tag 3) Use collection_selec ...
-
rails provinces cascade implementation
Page code is as follows: Provinces in the list box: City list box: js: action in the code are as follows:
-
ror development environment to build
Ror about the development environment set up, records are as follows. 1. Netbeans6.5 installation download netbeans6.5 address http://zh-cn.netbeans.org/download/6.5/ml/ Ruby can download a separate v ...
-
Rails2.0.2 change the default DB adpter
In Rails2.0.2 rails demo ... ... MissingSourceFile in SayController # hello no such file to load - sqlite3 RAILS_ROOT: / home / kenb / rails-projects / demo ... ... Checked config / database.yml, adpt ...
-
Spring2.0 + hibernate3.1 + log4j + mysql demo
applicationContext.xml Non-attachment jar package, necessary friends can send an email to todd.liangt @ gmail.com







