Radio-Button Formular ändern

  • Ersteller LittlePeopleGirl79
  • Erstellt am
L

LittlePeopleGirl79

Guest
Hallo
blink.gif
,

habe 2 Radiobutton und weitere Felder in einem Formular. Ich möchte es erreichen, das wenn man sich für ein Radiobutton entscheidet, der weitere Kontent für diesen Button disabled oder hidden wird!

Wie kann ich das machen?

Geht es auch die Seite neu mit den anderen Formular-Daten zu laden?


Als Verständnis:

O Button 1
O Button 2

[] Für Button 1
[] Für Button 1
....

[] Für Button 2
[] Für Button 2
....

Wenn Button 1 gewählt wird, sollte Kontent von Button 2 verschwinden oder nicht wählbar sein, oder die Seite wird nur mit Kontent von Button 1 neu geladen.

Gruß und Dank
 
Ich habe auch ein ähnliches problem *heul*

Geht wohl nur mit java (hab nix anderes gefunden)
biggrin.gif


Wenn du die Seite mit frames machst hab ich vielleicht ne kleine hilfe.

Ist zwar mit Pulldown aber müßte sich umschreiben lassen.

index.html
CODE
<!doctype html public "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<META HTTP-EQUIV="Expires" CONTENT="Tue, 01 Jan 1980 1:00:00 GMT">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<title>Pulldown erzeugt neues Pulldown</title>
</head>
<script language="javaScript"></script>
<frameset rows="10%,*" border=1 frameborder=1 framespacing=0>
<frameset cols="220,*" border=1 frameborder=1 framespacing=0>
<frame name="metabar" src="newpull2.html" scrolling=no marginheight=1 marginwidth=10>
<frame name="linkbar" src="blank.htm" scrolling=no marginheight=1 marginwidth=0>
</frameset>
<frame name="data" src="newpull3.html">
</frameset>
</HTML>
</body>



newpull2.html

CODE
<!doctype html public "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<META HTTP-EQUIV="Expires" CONTENT="Tue, 01 Jan 1980 1:00:00 GMT">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<title>Pulldown in Frame</title>
</head>
<script language="javaScript" src="../home/css.js"></script>
<body bgcolor="white" text="black">



<body BGCOLOR="white" text="black">

<script language="JavaScript">
<!--

function Go(x)
{
if(x == "nothing")
{
document.forms[0].reset();
document.forms[0].elements[0].blur();
return;
}
else if(x == "x")
{
parent.frames[2].location.href = x;
document.forms[0].reset();
document.forms[0].elements[0].blur();
}
else if(x == "end") location.href = parent.frames[1].location;
else
{
parent.frames[1].location.href = x;
document.forms[0].reset();
document.forms[0].elements[0].blur();
}
}
//-->
</script>
</head>
<body bgcolor=white>
<form name="MetaForm">
<select size=1 name="MetaAusw" onChange="Go(this.form.MetaAusw.options[this.form.MetaAusw.options.selectedIndex].value)" style="width:180px;">
<option value="nothing">[ Pull-Down Auswahl ]
<option value="nothing">----------------------------------
<option value="Pull-Down1.htm">Java Scripte
<option value="Pull-Down2.htm">Java Applet
<option value="Pull-Down3.htm">JavaScript-Befehle
<option value="nothing">----------------------------------
<option value="end">Pull-Down Auswahl beenden
</select>
</form>
</body>
</html>
</HTML>
</body>



newpull3.html

CODE
<!doctype html public "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<META HTTP-EQUIV="Expires" CONTENT="Tue, 01 Jan 1980 1:00:00 GMT">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<title>Pulldown in Frame</title>
</head>
<script language="javaScript" src="../home/css.js"></script>
<body bgcolor="white" text="black">
</HTML>
</body>



pull-down1.htm

CODE
<html>
<head>
<title>
</title>
</head>

<body BGCOLOR="white" text="black">
<script language="JavaScript">
<!--

function Go(x)
{
if(x == "nothing")
{
document.forms[0].reset();
document.forms[0].elements[0].blur();
parent.frames[2].focus();
return;
}
else
{
parent.frames[2].location.href = x;
document.forms[0].reset();
document.forms[0].elements[0].blur();
parent.frames[2].focus();
}
}
//-->
</script>
<body bgcolor=white>
<form name="JavascriptForm">
<select size=1 name="JavascriptAusw" onChange="Go(this.form.JavascriptAusw.options[this.form.JavascriptAusw.options.selectedIndex].value)" style="width:250px;">
<option value="nothing">[ Java Script ]
<option value="nothing">----------------------------------
<option value="1.htm">1.Beschreibung
<option value="2.htm">2.Beschreibung
<option value="3.htm">3.Beschreibung
<option value="4.htm">4.Beschreibung
</select>
</form>
</body>
</html>



pull-down2.htm

CODE
<html>
<head>
</head>

<body BGCOLOR="white" text="black">
<script language="JavaScript">
<!--
function Go(x)
{
if(x == "nothing")
{
document.forms[0].reset();
document.forms[0].elements[0].blur();
parent.frames[2].focus();
return;
}
else
{
parent.frames[2].location.href = x;
document.forms[0].reset();
document.forms[0].elements[0].blur();
parent.frames[2].focus();
}
}
//-->
</script>
<title>SELFHTML: Quickbar</title>
</head>

<body bgcolor=white class="doc">
<form name="JavaappletForm"><select size=1 name="JavaappletAusw" onChange="Go(this.form.JavaappletAusw.options[this.form.JavaappletAusw.options.selectedIndex].value)" style="width:250px;">
<option value="nothing">[ Java Applet ]
<option value="nothing">----------------------------------
<option value="1.htm">1.Beschreibung
<option value="2.htm">2.Beschreibung
<option value="3.htm">3.Beschreibung
<option value="4.htm">4.Beschreibung
</select>
</form>
</body>
</html>



pull-down3.htm

CODE
<html>
<head>
</head>

<body BGCOLOR="white" text="black">
<script language="JavaScript">
<!--
function Go(x)
{
if(x == "nothing")
{
document.forms[0].reset();
document.forms[0].elements[0].blur();
parent.frames[2].focus();
return;
}
else
{
parent.frames[2].location.href = x;
document.forms[0].reset();
document.forms[0].elements[0].blur();
parent.frames[2].focus();
return;
}
}
//-->
</script>
<title>SELFHTML: Quickbar</title>
</head>

<body bgcolor=white class="doc">
<form name="JavascriptbefehleForm"><select size=1 name="JavascriptbefehleAusw" onChange="Go(this.form.JavascriptbefehleAusw.options[this.form.JavascriptbefehleAusw.options.selectedIndex].value)" style="width:250px;">
<option value="nothing">[ Java Script-Befehle ]
<option value="nothing">----------------------------------
<option value="1.htm">1.Beschreibung
<option value="2.htm">2.Beschreibung
<option value="3.htm">3.Beschreibung
<option value="4.htm">4.Beschreibung
</select>
</form>
</body>
</html>




Ich hoffe das hilft dir weiter
biggrin.gif

 
Es gibt im JavaScript den Befehl "disabled". Damit kannst du verhindern, dass man das objekt anwählen kann.
Ich glaube um auf einen input zuzugreiffen sollte das etwa so aussehen:

input im html :
<form name="formular">
<input type="radio" name="input" value="1">
<input type="radio" name="input" value="2">
</form>
javascript zugriff auf input:
document.formular.input.disabled = true/false;

Ich hoffe ich konnte helfen

MfG iloma
 
Zurück
Oben