McKirahan,
Thank you very much for the help...it worked perfectly!
Mitch
McKirahan wrote:
> "mitch-co2" <> wrote in message
> news: oups.com...
> > What I am trying to do is when someone clicks on the YES radio
button I
> > want the text field called MYTEXT to equal the text field named
DATE.
> >
> > The below code works as long as I do NOT UN-COMMENT the NO radio
> > button, once I do that it will not work.
> >
> > Any help would be greatly appreciated.
> >
> > Mitch
> >
> >
> >
> > <body>
> > <script language="JavaScript"><!--
> > function setField(what) {
> > if (what.myTick.checked)
> > what.myText.value = what.date.value;
> > else
> > what.myText.value = '';
> > }
> > //--></script>
> >
> > <form>
> > <p>
> > Yes <input name="myTick" type="radio" value="Yes"
> > onClick="setField(this.form)">
> > <!-- No <input name="myTick" type="radio" value="No"> -->
> > </p>
> > <p>sample date
> > <input type="text" name="date" value="20050202">
> > auto fill in
> > <input type="text" name="myText">
> > </p>
> > </form>
> >
> > </body>
> >
>
> Will this help? Watch for word-wrap.
>
> <html>
> <head>
> <title>RadioYes.htm</title>
> <script type="text/javascript">
> function setField(form,what) {
> (what == 1) ? form.myText.value = form.date.value :
form.myText.value =
> "";
> }
> </script>
> </head>
> <body>
> <form>
> Yes <input name="myTick" type="radio" value="Yes"
> onClick="setField(this.form,1)">
> No <input name="myTick" type="radio" value="No"
> onClick="setField(this.form,0)">
> <br>sample date :
> <input type="text" name="date" value="20050202">
> <br>auto fill in :
> <input type="text" name="myText">
> </form>
> </body>
> </html>
|