Nickpage Mod "Dein Name" - Feld

Du hast Probleme beim Einbau oder bei der Benutzung eines Mods? In diesem Forum bist du richtig.
Forumsregeln
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.0, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
Antworten
reimic
Mitglied
Beiträge: 23
Registriert: 11.08.2004 09:00

Nickpage Mod "Dein Name" - Feld

Beitrag von reimic »

Hallo,

Was muss ich den ändern das dort auch so eine Javascriptfehlermeldung kommt wenn das feld nicht ausgefüllt wird...

Danke,

Lg
Reimic
reimic
Mitglied
Beiträge: 23
Registriert: 11.08.2004 09:00

Beitrag von reimic »

hab mich jetz selber mal hingesetzt und probiert. wenn ich es mit einem einfachem formular teste funktioniert die fehlermeldung.

also ich will das das namensfeld und die textarea kontrolliert werden ob wohl was drinnen steht.

dann bekomme ich diese fehlermeldung in zeile 5 zeichen 3:
'document.Formular.autor'ist Null oder kein Objekt.

ich will ein java script fenster wo eben drinnen steht: feld name ist leer bzw feld autor ist leer.

ist das wirklich so schwer zu machen??

Code: Alles auswählen

<script language="JavaScript" type="text/javascript">


function chkFormular () {
  if (document.Formular.autor.value == "") {
    alert("Bitte Ihren Namen eingeben!");
    document.Formular.autor.focus();
    return false;
  }
  if (document.Formular.message.value == "") {
    alert("Bitte Ihren Wohnort eingeben!");
    document.Formular.message.focus();
    return false;
  }
}
<!--
// bbCode control by
// subBlue design
// www.subBlue.com

// Startup variables
var imageTag = false;
var theSelection = false;

// Check for Browser & Platform for PC & IE specific bits
// More details from: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html
var clientPC = navigator.userAgent.toLowerCase(); // Get client info
var clientVer = parseInt(navigator.appVersion); // Get browser version

var is_ie = ((clientPC.indexOf("msie") != -1) && (clientPC.indexOf("opera") == -1));
var is_nav  = ((clientPC.indexOf('mozilla')!=-1) && (clientPC.indexOf('spoofer')==-1)
                && (clientPC.indexOf('compatible') == -1) && (clientPC.indexOf('opera')==-1)
                && (clientPC.indexOf('webtv')==-1) && (clientPC.indexOf('hotjava')==-1));

var is_win   = ((clientPC.indexOf("win")!=-1) || (clientPC.indexOf("16bit") != -1));
var is_mac    = (clientPC.indexOf("mac")!=-1);


// Helpline messages
b_help = "Text in fett: [b]Text[/b]  (alt+b)";
i_help = "Text in kursiv: [i]Text[/i]  (alt+i)";
u_help = "Unterstrichener Text: [u]Text[/u]  (alt+u)";
q_help = "Zitat: [quote]Text[/quote]  (alt+q)";
c_help = "Code anzeigen: [code]Code
(alt+c)";
l_help = "Liste:
  • Text
(alt+l)";
o_help = "Geordnete Liste:
  • Text
(alt+o)";
p_help = "Bild einfügen: [img]http://URL_des_Bildes[/img] (alt+p)";
w_help = "URL einfügen: http://URL oder URL Text (alt+w)";
a_help = "Alle offenen BBCodes schließen";
s_help = "Schriftfarbe: Text Tip: Sie können ebenfalls color=#FF0000 benutzen";
f_help = "Schriftgröße: [size=x-small]Kleiner Text[/size]";

// Define the bbCode tags
bbcode = new Array();
bbtags = new Array('','','','','','','[quote]','[/quote]','','
  • ','
','
  • ','
','[img]','[/img]','','');
imageTag = false;

// Shows the help messages in the helpline window
function helpline(help) {
document.post.helpbox.value = eval(help + "_help");
}


// Replacement for arrayname.length property
function getarraysize(thearray) {
for (i = 0; i < thearray.length; i++) {
if ((thearray == "undefined") || (thearray == "") || (thearray == null))
return i;
}
return thearray.length;
}

// Replacement for arrayname.push(value) not implemented in IE until version 5.5
// Appends element to the array
function arraypush(thearray,value) {
thearray[ getarraysize(thearray) ] = value;
}

// Replacement for arrayname.pop() not implemented in IE until version 5.5
// Removes and returns the last element of an array
function arraypop(thearray) {
thearraysize = getarraysize(thearray);
retval = thearray[thearraysize - 1];
delete thearray[thearraysize - 1];
return retval;
}



function emoticon(text) {
text = ' ' + text + ' ';
if (document.post.message.createTextRange && document.post.message.caretPos) {
var caretPos = document.post.message.caretPos;
caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
document.post.message.focus();
} else {
document.post.message.value += text;
document.post.message.focus();
}
}

function bbfontstyle(bbopen, bbclose) {
if ((clientVer >= 4) && is_ie && is_win) {
theSelection = document.selection.createRange().text;
if (!theSelection) {
document.post.message.value += bbopen + bbclose;
document.post.message.focus();
return;
}
document.selection.createRange().text = bbopen + theSelection + bbclose;
document.post.message.focus();
return;
} else {
document.post.message.value += bbopen + bbclose;
document.post.message.focus();
return;
}
storeCaret(document.post.message);
}


function bbstyle(bbnumber) {

donotinsert = false;
theSelection = false;
bblast = 0;

if (bbnumber == -1) { // Close all open tags & default button names
while (bbcode[0]) {
butnumber = arraypop(bbcode) - 1;
document.post.message.value += bbtags[butnumber + 1];
buttext = eval('document.post.addbbcode' + butnumber + '.value');
eval('document.post.addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"');
}
imageTag = false; // All tags are closed including image tags :D
document.post.message.focus();
return;
}

if ((clientVer >= 4) && is_ie && is_win)
theSelection = document.selection.createRange().text; // Get text selection

if (theSelection) {
// Add tags around selection
document.selection.createRange().text = bbtags[bbnumber] + theSelection + bbtags[bbnumber+1];
document.post.message.focus();
theSelection = '';
return;
}

// Find last occurance of an open tag the same as the one just clicked
for (i = 0; i < bbcode.length; i++) {
if (bbcode == bbnumber+1) {
bblast = i;
donotinsert = true;
}
}

if (donotinsert) { // Close all open tags up to the one just clicked & default button names
while (bbcode[bblast]) {
butnumber = arraypop(bbcode) - 1;
document.post.message.value += bbtags[butnumber + 1];
buttext = eval('document.post.addbbcode' + butnumber + '.value');
eval('document.post.addbbcode' + butnumber + '.value ="' + buttext.substr(0,(buttext.length - 1)) + '"');
imageTag = false;
}
document.post.message.focus();
return;
} else { // Open tags

if (imageTag && (bbnumber != 14)) { // Close image tag before adding another
document.post.message.value += bbtags[15];
lastValue = arraypop(bbcode) - 1; // Remove the close image tag from the list
document.post.addbbcode14.value = "Img"; // Return button back to normal state
imageTag = false;
}

// Open tag
document.post.message.value += bbtags[bbnumber];
if ((bbnumber == 14) && (imageTag == false)) imageTag = 1; // Check to stop additional tags after an unclosed image tag
arraypush(bbcode,bbnumber+1);
eval('document.post.addbbcode'+bbnumber+'.value += "*"');
document.post.message.focus();
return;
}
storeCaret(document.post.message);
}

// Insert at Claret position. Code from
// http://www.faqts.com/knowledge_base/vie ... 52/fid/130
function storeCaret(textEl) {
if (textEl.createTextRange) textEl.caretPos = document.selection.createRange().duplicate();
}

//-->
</script>
<form method="post" name="post" action="?user={Nickname}" onsubmit="return chkFormular()">
<table cellpadding="3" cellspacing="3" class="bodyline" align="center" width="90%">
<tr>
<td align="center"><span class="genmed">{U_WARNING}</span></td>
</tr>
<tr>
<td class="row1" align="center">
<table cellspacing="0" cellpadding="3">
<!-- BEGIN Autor -->
<tr>
<td><span class="genmed">{U_YOUR_NAME}:</span> <input type="text" name="autor" size="30" class="post"></td>
</tr>
<!-- END Autor -->
<tr>
<td width="100%" class="row2" valign="top">
<table width="450" border="0" cellspacing="0" cellpadding="2" align="center">
<tr align="center" valign="middle">
<td><span class="mediumtext">
<input type="button" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px" onClick="bbstyle(0)" onMouseOver="helpline('b')">
</span></td>
<td><span class="mediumtext">
<input type="button" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px" onClick="bbstyle(2)" onMouseOver="helpline('i')">
</span></td>
<td><span class="mediumtext">
<input type="button" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px" onClick="bbstyle(4)" onMouseOver="helpline('u')">
</span></td>
<td><span class="mediumtext">
<input type="button" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onClick="bbstyle(6)" onMouseOver="helpline('q')">
</span></td>
<td><span class="mediumtext">
<input type="button" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onClick="bbstyle(8)" onMouseOver="helpline('c')">
</span></td>
<td><span class="mediumtext">
<input type="button" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onClick="bbstyle(10)" onMouseOver="helpline('l')">
</span></td>
<td><span class="mediumtext">
<input type="button" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onClick="bbstyle(12)" onMouseOver="helpline('o')">
</span></td>
<td><span class="mediumtext">
<input type="button" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onClick="bbstyle(14)" onMouseOver="helpline('p')">
</span></td>
<td><span class="mediumtext">
<input type="button" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onClick="bbstyle(16)" onMouseOver="helpline('w')">
</span></td>
</tr>
<tr>
<td colspan="9">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><span class="genmed"> &nbsp;Schriftfarbe:
<select name="addbbcode18" onChange="bbfontstyle('[color=' + this.form.addbbcode18.options[this.form.addbbcode18.selectedIndex].value + ']', '[/color]')" onMouseOver="helpline('s')">
<option style="color:black; background-color: #FFFFFF " value="#" class="mediumtext">Standard</option>
<option style="color:darkred; background-color: #DEE3E7" value="darkred" class="mediumtext">Dunkelrot</option>
<option style="color:red; background-color: #DEE3E7" value="red" class="mediumtext">Rot</option>
<option style="color:orange; background-color: #DEE3E7" value="orange" class="mediumtext">Orange</option>
<option style="color:brown; background-color: #DEE3E7" value="brown" class="mediumtext">Braun</option>
<option style="color:yellow; background-color: #DEE3E7" value="yellow" class="mediumtext">Gelb</option>
<option style="color:green; background-color: #DEE3E7" value="green" class="mediumtext">Grün</option>
<option style="color:olive; background-color: #DEE3E7" value="olive" class="mediumtext">Oliv</option>
<option style="color:cyan; background-color: #DEE3E7" value="cyan" class="mediumtext">Cyan</option>
<option style="color:blue; background-color: #DEE3E7" value="blue" class="mediumtext">Blau</option>
<option style="color:darkblue; background-color: #DEE3E7" value="darkblue" class="mediumtext">Dunkelblau</option>
<option style="color:indigo; background-color: #DEE3E7" value="indigo" class="mediumtext">Indigo</option>
<option style="color:violet; background-color: #DEE3E7" value="violet" class="mediumtext">Violett</option>
<option style="color:white; background-color: #DEE3E7" value="white" class="mediumtext">Weiß</option>
<option style="color:black; background-color: #DEE3E7" value="black" class="mediumtext">Schwarz</option>
</select>
&nbsp;Schriftgröße:
<select name="addbbcode20" onChange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]')" onMouseOver="helpline('f')">
<option value="7" class="mediumtext">Winzig</option>
<option value="9" class="mediumtext">Klein</option>
<option value="12" selected class="mediumtext">Normal</option>
<option value="18" class="mediumtext">Groß</option>
<option value="24" class="mediumtext">Riesig</option>
</select>
</span></td>
<td nowrap align="right"><span class="smalltext"><a href="javascript:bbstyle(-1)" class="genmed" onMouseOver="helpline('a')">Tags schließen</a></span></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="9"> <span class="smalltext">
<input type="text" name="helpbox" size="45" maxlength="100" style="width:450px; font-size:10px" class="row1" value="Tip: Styles können schnell zum markierten Text hinzugefügt werden">
</span></td>
</tr>
<tr>
<th class="catHead" align="left" colspan="9">{U_MESSAGE_TO} <b>{Nickname}</b>:</td>
</tr>
<tr>
<td colspan="9"><span class="mediumtext">
<textarea name="message" rows="15" cols="35" wrap="virtual" style="width:450px" tabindex="3" class="post" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);"></textarea>
</span></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="100%" align="center" class="row1">
<input type="submit" accesskey="s" tabindex="6" name="addgbentry" class="mainoption" value="{U_ADD_ENTRY}" /></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
</table>
</td>
</tr>
</table>
</form>[/code]
reimic
Mitglied
Beiträge: 23
Registriert: 11.08.2004 09:00

Beitrag von reimic »

aaa ich weiß schon :lol:

ich muss statt "formular" -->"post" nehmen da ja die form so benannt wurde :)
Antworten

Zurück zu „phpBB 2.0: Mod Support“