onmousedown="set(news.text.form,'-!-');"

Status
Nicht offen für weitere Antworten.

GodWar

Erfahrenes Mitglied
Habe ein kleines Formproblem! Unteres Script fügt in eine Textbox einen Smiliecode ein Klappt alles wunderbar, bis auf einen Schönheitsfehler. Ist der Imagebutton innerhalb der Form fügt er das Smilie ein und führt das Script aus. Ist der Imagebutton außerhalb der Form fügt er das Smily ein.

<input type="image" onmousedown="set(news.text.form,'-!-');" src="images/smilies/ausrufezeichen.gif" width="20" height="20" border="0" />

Bei einer Verschachteltet Tabelle ist es aber unmöglich die Form vorher zu schließen! Oder gibt es noch einer andere Möglichkeit einen Grafischen Button einen Smilieinputbefehl zuzuweißen?

Vielen Dank

Code:
<form name="news" title="news" method="post" action="?p=admin_news_add&do=add_check">
  <table width="490" border="0" cellspacing="0" cellpadding="0" class="news_rahmen">
                <tr>
                  <td  class="admin_news_add_rahmen"><table width="100" border="0" cellspacing="5" cellpadding="0">
                      <tr>
                        <td><input class="inputbox1" type="text" value="Titel:" /></td>
                      </tr>
                    </table></td>
                  <td class="admin_news_add_rahmen"><table width="100%" border="0" cellspacing="5" cellpadding="0">
                      <tr>
                        <td><input class="inputbox2" name="titel" type="text" id="titel" maxlength="200" value="<?=$newstitel?>" /></td>
                      </tr>
                    </table></td>
                <tr>
                  <td class="admin_news_add_rahmen"><table width="100" border="0" cellspacing="5" cellpadding="0">
                      <tr>
                        <td><input class="inputbox1" type="text" value="Bild:" /></td>
                      </tr>
                    </table></td>
                  <td class="admin_news_add_rahmen"><table width="100%" border="0" cellspacing="5" cellpadding="0">
                      <tr>
                        <td><input class="inputbox2" name="newsbild" type="text" id="newsbild" maxlength="1000" value="<?=$newsnewsbild?>" /></td>
                      </tr>
                    </table></td>
                <tr>
                  <td class="admin_news_add_rahmen"><table width="100" border="0" cellspacing="5" cellpadding="0">
                      <tr>
                        <td><input class="inputbox1" type="text" value="Quelle:" /></td>
                      </tr>
                    </table></td>
                  <td class="admin_news_add_rahmen"><table width="100%" border="0" cellspacing="5" cellpadding="0">
                      <tr>
                        <td><input class="inputbox2" name="quelle" type="text" id="quelle" maxlength="100" value="<?=$newsquelle?>" /></td>
                      </tr>
                    </table></td>
                <tr>
                  <td valign="top" class="admin_news_add_rahmen"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td><table width="100" border="0" cellspacing="5" cellpadding="0">
                            <tr>
                              <td colspan="3"><input name="text2" type="text" class="inputbox1" value="Smilies:" /></td>
                            </tr>
                            <tr>
                              <td align="center"><input type="image" onmousedown="set(news.text.form,'-!-');" src="images/smilies/ausrufezeichen.gif" width="20" height="20" border="0" /></td>
                              <td align="center"><input type="image" onmousedown="set(news.text.form,'-!-');" src="images/smilies/ausrufezeichen.gif" width="20" height="20" border="0" /></td>
                              <td align="center"><input type="image" onmousedown="set(news.text.form,'-!-');" src="images/smilies/ausrufezeichen.gif" width="20" height="20" border="0" /></td>
                            </tr>
                            <tr>
                              <td align="center"><input type="image" onmousedown="set(news.text.form,'-!-');" src="images/smilies/ausrufezeichen.gif" width="20" height="20" border="0" /></td>
                              <td align="center"><input type="image" onmousedown="set(news.text.form,'-!-');" src="images/smilies/ausrufezeichen.gif" width="20" height="20" border="0" /></td>
                              <td align="center"><input type="image" onmousedown="set(news.text.form,'-!-');" src="images/smilies/ausrufezeichen.gif" width="20" height="20" border="0" /></td>
                            </tr>
                            <tr>
                              <td align="center"><input type="image" onmousedown="set(news.text.form,'-!-');" src="images/smilies/ausrufezeichen.gif" width="20" height="20" border="0" /></td>
                              <td align="center"><input type="image" onmousedown="set(news.text.form,'-!-');" src="images/smilies/ausrufezeichen.gif" width="20" height="20" border="0" /></td>
                              <td align="center"><input type="image" onmousedown="set(news.text.form,'-!-');" src="images/smilies/ausrufezeichen.gif" width="20" height="20" border="0" /></td>
                            </tr>
                            <tr>
                              <td align="center"><input type="image" onmousedown="set(news.text.form,'-!-');" src="images/smilies/ausrufezeichen.gif" width="20" height="20" border="0" /></td>
                              <td align="center"><input type="image" onmousedown="set(news.text.form,'-!-');" src="images/smilies/ausrufezeichen.gif" width="20" height="20" border="0" /></td>
                              <td align="center"><input type="image" onmousedown="set(news.text.form,'-!-');" src="images/smilies/ausrufezeichen.gif" width="20" height="20" border="0" /></td>
                            </tr>
                            <tr>
                              <td align="center"><input type="image" onmousedown="set(news.text.form,'-!-');" src="images/smilies/ausrufezeichen.gif" width="20" height="20" border="0" /></td>
                              <td align="center"><input type="image" onmousedown="set(news.text.form,'-!-');" src="images/smilies/ausrufezeichen.gif" width="20" height="20" border="0" /></td>
                              <td align="center"><input type="image" onmousedown="set(news.text.form,'-!-');" src="images/smilies/ausrufezeichen.gif" width="20" height="20" border="0" /></td>
                            </tr>
                            <tr>
                              <td align="center"><input type="image" onmousedown="set(news.text.form,'-!-');" src="images/smilies/ausrufezeichen.gif" width="20" height="20" border="0" /></td>
                              <td align="center"><input type="image" onmousedown="set(news.text.form,'-!-');" src="images/smilies/ausrufezeichen.gif" width="20" height="20" border="0" /></td>
                              <td align="center"><input type="image" onmousedown="set(news.text.form,'-!-');" src="images/smilies/ausrufezeichen.gif" width="20" height="20" border="0" /></td>
                            </tr>
                            <tr>
                              <td align="center"><input type="image" onmousedown="set(news.text.form,'-!-');" src="images/smilies/ausrufezeichen.gif" width="20" height="20" border="0" /></td>
                              <td align="center"><input type="image" onmousedown="set(news.text.form,'-!-');" src="images/smilies/ausrufezeichen.gif" width="20" height="20" border="0" /></td>
                              <td align="center"><input type="image" onmousedown="set(news.text.form,'-!-');" src="images/smilies/ausrufezeichen.gif" width="20" height="20" border="0" /></td>
                            </tr>
                            <tr>
                              <td align="center"><input type="image" onmousedown="set(news.text.form,'-!-');" src="images/smilies/ausrufezeichen.gif" width="20" height="20" border="0" /></td>
                              <td align="center"><input type="image" onmousedown="set(news.text.form,'-!-');" src="images/smilies/ausrufezeichen.gif" width="20" height="20" border="0" /></td>
                              <td align="center"><input type="image" onmousedown="set(news.text.form,'-!-');" src="images/smilies/ausrufezeichen.gif" width="20" height="20" border="0" /></td>
                            </tr>
                          </table></td>
                      </tr>
                    </table></td>
                  <td valign="top" class="admin_news_add_rahmen"><table width="100%" border="0" cellspacing="5" cellpadding="0">
                      <tr>
                        <td><textarea class="news" name="text" cols="40">
                          </textarea></td>
                      </tr>
                    </table></td>
                <tr>
                  <td class="text">&nbsp;</td>
                  <td class="text"><table width="100%" border="0" cellspacing="5" cellpadding="0">
                      <tr>
                        <td><input class="inputbox2" name="submit" type="submit" value="Eintragen" /></td>
                      </tr>
                    </table></td>
              </table>
</form>
 
Wenn du nicht willst, dass das Formular gesendet wird, nehme statt des <input> ein <img>.
JS-Anweisungen kannst du auch dort notieren.
 
Status
Nicht offen für weitere Antworten.
Zurück