Ragazzi,
Ho un modulo con una serie di bottoni che una volta cliccati chiamano la funzione InsertHtml(TagNum)
Ecco l'esempio:<input type="button" width="130" style="width: 130" value="Grassetto" name="B1" onclick="InsertHtml('1');">
Vorrei fare in modo che la stessa cosa accada anche con le select tipo questa:
<select name="fontselect">
<option value="0">FONT</option>
<option value="arial">Arial</option>
<option value="times new roman">Times</option>
<option value="courier new">Courier</option>
<option value="century gothic">Century</option>
</select>
Io ho pensato di fare cosi ma non funziona ....
Praticamente dovrebbe venire una cosa del genere:codice:function InsertHtml(TagNum) { var HtmTag1 = ""; var HtmTag2 = ""; if ( LastFocus != "" ) { SavePreviousTextInput(); switch ( TagNum ) { case "1" : HtmTag1 = ""; HtmTag2 = ""; break; case "2" : HtmTag1 = ""; HtmTag2 = ""; break; case "3" : HtmTag1 = " "; HtmTag2 = "</p>"; break; case "4" : HtmTag1 = "<ul>\n[*]"; HtmTag2 = "\n[/list]"; break; case "5" : HtmTag1 = " "; HtmTag2 = ""; break; case "6" : HtmTag1 = "<centerpar>"; HtmTag2 = "</centerpar>"; break; case "7" : HtmTag1 = "<justifiedpar>"; HtmTag2 = "</justifiedpar>"; break; case "8" : HtmTag1 = "<rightpar>"; HtmTag2 = "</rightpar>"; break; case "9" : HtmTag1 = "<wwwlink>"; HtmTag2 = "</wwwlink>"; break; case "10" : HtmTag1 = "<mailto>"; HtmTag2 = "</mailto>"; break; case "11" : HtmTag1 = "<font='+document.bottoni.fontselect.options[document.bottoni.fontselct.selectedIndex].value; +'>"; HtmTag2 = "</font>"; break; default : HtmTag = ""; }
HtmTag1 = "<font=Times New Roman>";
HtmTag2 = "</font>";

Rispondi quotando