Ich habe ein paar Links, die ich per Button in ein Textfeld einfügen kann:
Code: Alles auswählen
<script type="text/javascript">
//<![CDATA[
function insertAtCursor(wo, was) {
wo = document.getElementById(wo)
//IE
if (document.selection) {
wo.focus()
sel = document.selection.createRange()
sel.text = was
}
//MOZILLA/NETSCAPE
else if (wo.selectionStart || wo.selectionStart == '0') {
var startPos = wo.selectionStart
var endPos = wo.selectionEnd
wo.value = wo.value.substring(0, startPos)
+ was
+ wo.value.substring(endPos, wo.value.length)
} else {
wo.value += was
}
wo.focus()
}
//]]>
</script>
Code: Alles auswählen
<input type="button" value="Broschyr Svetsning" onclick="insertAtCursor('data_answer', ' http://www.maskinisten.net/ssab_docs/11-Welding-SE-V1-2007.pdf ')" /> <input type="button" value="Broschyr Bockning/Klippning" onclick="insertAtCursor('data_answer', ' http://www.maskinisten.net/ssab_docs/se_recommend_hxwx_bending_12_v3.pdf ')" /> <input type="button" value="Broschyr Bearbetning" onclick="insertAtCursor('data_answer', ' http://www.maskinisten.net/ssab_docs/se_recommend_hxwx_machining_10_v1.pdf ')" /> <input type="button" value="Broschyr Skärning" onclick="insertAtCursor('data_answer', ' http://www.maskinisten.net/ssab_docs/ts_16_cutting_se_v2_2005.pdf ')" />
Wie stelle ich das an?
Gruss
Holger