Avatar billede dkkarpen Nybegynder
10. juli 2002 - 13:11 Der er 18 kommentarer og
1 løsning

Hent variabel fra popup vindue

Halløj

Jeg har en fil til at vælge farve med. Hvordan hiver jeg min variabel (farvekoden) og farver en input knap eller en celle med farveværdien i opener vinduet?
Avatar billede dkkarpen Nybegynder
10. juli 2002 - 13:19 #1
Her er noget kode:

<HTML>
<HEAD>
<TITLE>Vælg farve</TITLE>

<STYLE TYPE="text/css">
BODY  {margin-left:10; font-family:Verdana; font-size:12; background:menu}
BUTTON {width:5em}
P      {text-align:center}
TABLE  {cursor:hand}
</STYLE>

<SCRIPT LANGUAGE=JavaScript FOR=ColorTable EVENT=onclick>
  SelColor.value = event.srcElement.title;
</SCRIPT>

<SCRIPT LANGUAGE=JavaScript FOR=ColorTable EVENT=onmouseover>
  text = event.srcElement.title;
  if ( text != event.srcElement.bgColor )
    text += " (" + event.srcElement.bgColor + ")";
  RGB.innerText = text;
</SCRIPT>

<SCRIPT LANGUAGE=JavaScript FOR=ColorTable EVENT=onmouseout>
  RGB.innerText = " ";
</SCRIPT>

<SCRIPT LANGUAGE=JavaScript FOR=Ok EVENT=onclick>
  window.returnValue = SelColor.value;
  window.close();
</SCRIPT>

</HEAD>

<!-- Copyright 1998 Microsoft Corporation. All rights reserved. -->
<BODY>

<DIV> &nbsp; </DIV>
<P>
<TABLE ID=ColorTable
BORDER=1
BORDERCOLOR=SILVER
BORDERCOLORLIGHT=WHITE
BORDERCOLORDARK=BLACK
CELLSPACING=0
CELLPADDING=0>
<TR>
<TD BGCOLOR=aliceblue TITLE=aliceblue>&nbsp;&nbsp;&nbsp;
<TD BGCOLOR=antiquewhite TITLE=antiquewhite>&nbsp;&nbsp;&nbsp;
<TD BGCOLOR=aqua TITLE=aqua>&nbsp;&nbsp;&nbsp;
<TD BGCOLOR=aquamarine TITLE=aquamarine>&nbsp;&nbsp;&nbsp;
<TD BGCOLOR=azure TITLE=azure>&nbsp;&nbsp;&nbsp;
<TD BGCOLOR=beige TITLE=beige>&nbsp;&nbsp;&nbsp;
<TD BGCOLOR=bisque TITLE=bisque>&nbsp;&nbsp;&nbsp;
<TD BGCOLOR=black TITLE=black>&nbsp;&nbsp;&nbsp;
<TD BGCOLOR=blanchedalmond TITLE=blanchedalmond>&nbsp;&nbsp;&nbsp;
<TD BGCOLOR=blue TITLE=blue>&nbsp;&nbsp;&nbsp;
<TD BGCOLOR=blueviolet TITLE=blueviolet>&nbsp;&nbsp;&nbsp;
<TD BGCOLOR=brown TITLE=brown>&nbsp;&nbsp;&nbsp;
<TD BGCOLOR=burlywood TITLE=burlywood>&nbsp;&nbsp;&nbsp;
<TD BGCOLOR=cadetblue TITLE=cadetblue>&nbsp;&nbsp;&nbsp;
<TD BGCOLOR=chartreuse TITLE=chartreuse>&nbsp;&nbsp;&nbsp;
<TD BGCOLOR=chocolate TITLE=chocolate>&nbsp;&nbsp;&nbsp;
<TR>
<TD BGCOLOR=coral TITLE=coral>&nbsp;&nbsp;
<TD BGCOLOR=cornflower TITLE=cornflower>&nbsp;&nbsp;
<TD BGCOLOR=cornsilk TITLE=cornsilk>&nbsp;&nbsp;
<TD BGCOLOR=crimson TITLE=crimson>&nbsp;&nbsp;
<TD BGCOLOR=cyan TITLE=cyan>&nbsp;&nbsp;
<TD BGCOLOR=darkblue TITLE=darkblue>&nbsp;&nbsp;
<TD BGCOLOR=darkcyan TITLE=darkcyan>&nbsp;&nbsp;
<TD BGCOLOR=darkgoldenrod TITLE=darkgoldenrod>&nbsp;&nbsp;
<TD BGCOLOR=darkgray TITLE=darkgray>&nbsp;&nbsp;
<TD BGCOLOR=darkgreen TITLE=darkgreen>&nbsp;&nbsp;
<TD BGCOLOR=darkkhaki TITLE=darkkhaki>&nbsp;&nbsp;
<TD BGCOLOR=darkmagenta TITLE=darkmagenta>&nbsp;&nbsp;
<TD BGCOLOR=darkolivegreen TITLE=darkolivegreen>&nbsp;&nbsp;
<TD BGCOLOR=darkorange TITLE=darkorange>&nbsp;&nbsp;
<TD BGCOLOR=darkorchid TITLE=darkorchid>&nbsp;&nbsp;
<TD BGCOLOR=darkred TITLE=darkred>&nbsp;&nbsp;
<TR>
<TD BGCOLOR=darksalmon TITLE=darksalmon>&nbsp;&nbsp;
<TD BGCOLOR=darkseagreen TITLE=darkseagreen>&nbsp;&nbsp;
<TD BGCOLOR=darkslateblue TITLE=darkslateblue>&nbsp;&nbsp;
<TD BGCOLOR=darkslategray TITLE=darkslategray>&nbsp;&nbsp;
<TD BGCOLOR=darkturquoise TITLE=darkturquoise>&nbsp;&nbsp;
<TD BGCOLOR=darkviolet TITLE=darkviolet>&nbsp;&nbsp;
<TD BGCOLOR=deeppink TITLE=deeppink>&nbsp;&nbsp;
<TD BGCOLOR=deepskyblue TITLE=deepskyblue>&nbsp;&nbsp;
<TD BGCOLOR=dimgray TITLE=dimgray>&nbsp;&nbsp;
<TD BGCOLOR=dodgerblue TITLE=dodgerblue>&nbsp;&nbsp;
<TD BGCOLOR=firebrick TITLE=firebrick>&nbsp;&nbsp;
<TD BGCOLOR=floralwhite TITLE=floralwhite>&nbsp;&nbsp;
<TD BGCOLOR=forestgreen TITLE=forestgreen>&nbsp;&nbsp;
<TD BGCOLOR=fuchia TITLE=fuchia>&nbsp;&nbsp;
<TD BGCOLOR=gainsboro TITLE=gainsboro>&nbsp;&nbsp;
<TD BGCOLOR=ghostwhite TITLE=ghostwhite>&nbsp;&nbsp;
<TR>
<TD BGCOLOR=gold TITLE=gold>&nbsp;&nbsp;
<TD BGCOLOR=goldenrod TITLE=goldenrod>&nbsp;&nbsp;
<TD BGCOLOR=gray TITLE=gray>&nbsp;&nbsp;
<TD BGCOLOR=green TITLE=green>&nbsp;&nbsp;
<TD BGCOLOR=greenyellow TITLE=greenyellow>&nbsp;&nbsp;
<TD BGCOLOR=honeydew TITLE=honeydew>&nbsp;&nbsp;
<TD BGCOLOR=hotpink TITLE=hotpink>&nbsp;&nbsp;
<TD BGCOLOR=indianred TITLE=indianred>&nbsp;&nbsp;
<TD BGCOLOR=indigo TITLE=indigo>&nbsp;&nbsp;
<TD BGCOLOR=ivory TITLE=ivory>&nbsp;&nbsp;
<TD BGCOLOR=khaki TITLE=khaki>&nbsp;&nbsp;
<TD BGCOLOR=lavender TITLE=lavender>&nbsp;&nbsp;
<TD BGCOLOR=lavenderblush TITLE=lavenderblush>&nbsp;&nbsp;
<TD BGCOLOR=lawngreen TITLE=lawngreen>&nbsp;&nbsp;
<TD BGCOLOR=lemonchiffon TITLE=lemonchiffon>&nbsp;&nbsp;
<TD BGCOLOR=lightblue TITLE=lightblue>&nbsp;&nbsp;
<TR>
<TD BGCOLOR=lightcoral TITLE=lightcoral>&nbsp;&nbsp;
<TD BGCOLOR=lightcyan TITLE=lightcyan>&nbsp;&nbsp;
<TD BGCOLOR=lightgoldenrodyellow TITLE=lightgoldenrodyellow>&nbsp;&nbsp;
<TD BGCOLOR=lightgreen TITLE=lightgreen>&nbsp;&nbsp;
<TD BGCOLOR=lightgrey TITLE=lightgrey>&nbsp;&nbsp;
<TD BGCOLOR=lightpink TITLE=lightpink>&nbsp;&nbsp;
<TD BGCOLOR=lightsalmon TITLE=lightsalmon>&nbsp;&nbsp;
<TD BGCOLOR=lightseagreen TITLE=lightseagreen>&nbsp;&nbsp;
<TD BGCOLOR=lightskyblue TITLE=lightskyblue>&nbsp;&nbsp;
<TD BGCOLOR=lightslategray TITLE=lightslategray>&nbsp;&nbsp;
<TD BGCOLOR=lightsteelblue TITLE=lightsteelblue>&nbsp;&nbsp;
<TD BGCOLOR=lightyellow TITLE=lightyellow>&nbsp;&nbsp;
<TD BGCOLOR=lime TITLE=lime>&nbsp;&nbsp;
<TD BGCOLOR=limegreen TITLE=limegreen>&nbsp;&nbsp;
<TD BGCOLOR=linen TITLE=linen>&nbsp;&nbsp;
<TD BGCOLOR=magenta TITLE=magenta>&nbsp;&nbsp;
<TR>
<TD BGCOLOR=maroon TITLE=maroon>&nbsp;&nbsp;
<TD BGCOLOR=mediumaquamarine TITLE=mediumaquamarine>&nbsp;&nbsp;
<TD BGCOLOR=mediumblue TITLE=mediumblue>&nbsp;&nbsp;
<TD BGCOLOR=mediumorchid TITLE=mediumorchid>&nbsp;&nbsp;
<TD BGCOLOR=mediumpurple TITLE=mediumpurple>&nbsp;&nbsp;
<TD BGCOLOR=mediumseagreen TITLE=mediumseagreen>&nbsp;&nbsp;
<TD BGCOLOR=mediumslateblue TITLE=mediumslateblue>&nbsp;&nbsp;
<TD BGCOLOR=mediumspringgreen TITLE=mediumspringgreen>&nbsp;&nbsp;
<TD BGCOLOR=mediumturquoise TITLE=mediumturquoise>&nbsp;&nbsp;
<TD BGCOLOR=mediumvioletred TITLE=mediumvioletred>&nbsp;&nbsp;
<TD BGCOLOR=midnightblue TITLE=midnightblue>&nbsp;&nbsp;
<TD BGCOLOR=mintcream TITLE=mintcream>&nbsp;&nbsp;
<TD BGCOLOR=mistyrose TITLE=mistyrose>&nbsp;&nbsp;
<TD BGCOLOR=moccasin TITLE=moccasin>&nbsp;&nbsp;
<TD BGCOLOR=navajowhite TITLE=navajowhite>&nbsp;&nbsp;
<TD BGCOLOR=navy TITLE=navy>&nbsp;&nbsp;
<TR>
<TD BGCOLOR=oldlace TITLE=oldlace>&nbsp;&nbsp;
<TD BGCOLOR=olive TITLE=olive>&nbsp;&nbsp;
<TD BGCOLOR=olivedrab TITLE=olivedrab>&nbsp;&nbsp;
<TD BGCOLOR=orange TITLE=orange>&nbsp;&nbsp;
<TD BGCOLOR=orangered TITLE=orangered>&nbsp;&nbsp;
<TD BGCOLOR=orchid TITLE=orchid>&nbsp;&nbsp;
<TD BGCOLOR=palegoldenrod TITLE=palegoldenrod>&nbsp;&nbsp;
<TD BGCOLOR=palegreen TITLE=palegreen>&nbsp;&nbsp;
<TD BGCOLOR=paleturquoise TITLE=paleturquoise>&nbsp;&nbsp;
<TD BGCOLOR=palevioletred TITLE=palevioletred>&nbsp;&nbsp;
<TD BGCOLOR=papayawhip TITLE=papayawhip>&nbsp;&nbsp;
<TD BGCOLOR=peachpuff TITLE=peachpuff>&nbsp;&nbsp;
<TD BGCOLOR=peru TITLE=peru>&nbsp;&nbsp;
<TD BGCOLOR=pink TITLE=pink>&nbsp;&nbsp;
<TD BGCOLOR=plum TITLE=plum>&nbsp;&nbsp;
<TD BGCOLOR=powderblue TITLE=powderblue>&nbsp;&nbsp;
<TR>
<TD BGCOLOR=purple TITLE=purple>&nbsp;&nbsp;
<TD BGCOLOR=red TITLE=red>&nbsp;&nbsp;
<TD BGCOLOR=rosybrown TITLE=rosybrown>&nbsp;&nbsp;
<TD BGCOLOR=royalblue TITLE=royalblue>&nbsp;&nbsp;
<TD BGCOLOR=saddlebrown TITLE=saddlebrown>&nbsp;&nbsp;
<TD BGCOLOR=salmon TITLE=salmon>&nbsp;&nbsp;
<TD BGCOLOR=sandybrown TITLE=sandybrown>&nbsp;&nbsp;
<TD BGCOLOR=seagreen TITLE=seagreen>&nbsp;&nbsp;
<TD BGCOLOR=seashell TITLE=seashell>&nbsp;&nbsp;
<TD BGCOLOR=sienna TITLE=sienna>&nbsp;&nbsp;
<TD BGCOLOR=silver TITLE=silver>&nbsp;&nbsp;
<TD BGCOLOR=skyblue TITLE=skyblue>&nbsp;&nbsp;
<TD BGCOLOR=slateblue TITLE=slateblue>&nbsp;&nbsp;
<TD BGCOLOR=slategray TITLE=slategray>&nbsp;&nbsp;
<TD BGCOLOR=snow TITLE=snow>&nbsp;&nbsp;
<TD BGCOLOR=springgreen TITLE=springgreen>&nbsp;&nbsp;
<TR>
<TD BGCOLOR=steelblue TITLE=steelblue>&nbsp;&nbsp;
<TD BGCOLOR=tan TITLE=tan>&nbsp;&nbsp;
<TD BGCOLOR=teal TITLE=teal>&nbsp;&nbsp;
<TD BGCOLOR=thistle TITLE=thistle>&nbsp;&nbsp;
<TD BGCOLOR=tomato TITLE=tomato>&nbsp;&nbsp;
<TD BGCOLOR=turquoise TITLE=turquoise>&nbsp;&nbsp;
<TD BGCOLOR=violet TITLE=violet>&nbsp;&nbsp;
<TD BGCOLOR=wheat TITLE=wheat>&nbsp;&nbsp;
<TD BGCOLOR=white TITLE=white>&nbsp;&nbsp;
<TD BGCOLOR=whitesmoke TITLE=whitesmoke>&nbsp;&nbsp;
<TD BGCOLOR=yellow TITLE=yellow>&nbsp;&nbsp;
<TD BGCOLOR=yellowgreen TITLE=yellowgreen>&nbsp;&nbsp;
</TABLE>

<P>
<LABEL FOR=SelColor>Farve:</LABEL>
<INPUT TYPE=TEXT SIZE=20 ID=SelColor>
<BR>
<SPAN ID=RGB>&nbsp;</SPAN>

<P>
<BUTTON ID=Ok TYPE=SUBMIT>OK</BUTTON>
<BUTTON ONCLICK="window.close();">Annuller</BUTTON>

</BODY>
</HTML>
Avatar billede hmm10 Nybegynder
10. juli 2002 - 13:24 #2
Smart skema. Måske skulle du lave en sammenhæng mellem alle dine farver. det ser forvirende ud, når de er blandet sådanne.
Avatar billede dkkarpen Nybegynder
10. juli 2002 - 13:25 #3
Ja måske. Men har du et svar?
Avatar billede hmm10 Nybegynder
10. juli 2002 - 13:28 #4
nej, desværre. Jeg kan ikke løse dit problem.
Avatar billede dkkarpen Nybegynder
10. juli 2002 - 13:29 #5
I opener vinduet har jeg en knap der viser farven:

  <input type="button" value="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" style="background-color:#FFFFFF" onclick="window.open('selcolor.asp')">

selcolor.asp er filen hvis kode er vist ovenfor.
Avatar billede =maddog= Nybegynder
10. juli 2002 - 13:42 #6
<BUTTON ID=Ok TYPE=SUBMIT onclick="opener.document.getElementById('detderskalfarves_id').style.backgroundColor=document.getElementById('SelColor').value;">OK</BUTTON>
Avatar billede mikoalngelo Nybegynder
10. juli 2002 - 13:49 #7
<HTML>
<HEAD>
<TITLE>Vælg farve</TITLE>

<STYLE TYPE="text/css">
BODY  {margin-left:10; font-family:Verdana; font-size:12; background:menu}
BUTTON {width:5em}
P      {text-align:center}
TABLE  {cursor:hand}
</STYLE>

<SCRIPT LANGUAGE=JavaScript FOR=ColorTable EVENT=onclick>
  SelColor.value = event.srcElement.title;
</SCRIPT>

<SCRIPT LANGUAGE=JavaScript FOR=ColorTable EVENT=onmouseover>
  text = event.srcElement.title;
  if ( text != event.srcElement.bgColor )
    text += " (" + event.srcElement.bgColor + ")";
  RGB.innerText = text;
</SCRIPT>

<SCRIPT LANGUAGE=JavaScript FOR=ColorTable EVENT=onmouseout>
  RGB.innerText = " ";
</SCRIPT>

<SCRIPT LANGUAGE=JavaScript FOR=Ok EVENT=onclick>
  window.opener.forms['f'].elements['farve'].style.backgroundColor = SelColor.value;
  window.close();
</SCRIPT>

</HEAD>

<!-- Copyright 1998 Microsoft Corporation. All rights reserved. -->
<BODY>

<DIV> &nbsp; </DIV>
<P>
<TABLE ID=ColorTable
BORDER=1
BORDERCOLOR=SILVER
BORDERCOLORLIGHT=WHITE
BORDERCOLORDARK=BLACK
CELLSPACING=0
CELLPADDING=0>
<TR>
<TD BGCOLOR=aliceblue TITLE=aliceblue>&nbsp;&nbsp;&nbsp;
<TD BGCOLOR=antiquewhite TITLE=antiquewhite>&nbsp;&nbsp;&nbsp;
<TD BGCOLOR=aqua TITLE=aqua>&nbsp;&nbsp;&nbsp;
<TD BGCOLOR=aquamarine TITLE=aquamarine>&nbsp;&nbsp;&nbsp;
<TD BGCOLOR=azure TITLE=azure>&nbsp;&nbsp;&nbsp;
<TD BGCOLOR=beige TITLE=beige>&nbsp;&nbsp;&nbsp;
<TD BGCOLOR=bisque TITLE=bisque>&nbsp;&nbsp;&nbsp;
<TD BGCOLOR=black TITLE=black>&nbsp;&nbsp;&nbsp;
<TD BGCOLOR=blanchedalmond TITLE=blanchedalmond>&nbsp;&nbsp;&nbsp;
<TD BGCOLOR=blue TITLE=blue>&nbsp;&nbsp;&nbsp;
<TD BGCOLOR=blueviolet TITLE=blueviolet>&nbsp;&nbsp;&nbsp;
<TD BGCOLOR=brown TITLE=brown>&nbsp;&nbsp;&nbsp;
<TD BGCOLOR=burlywood TITLE=burlywood>&nbsp;&nbsp;&nbsp;
<TD BGCOLOR=cadetblue TITLE=cadetblue>&nbsp;&nbsp;&nbsp;
<TD BGCOLOR=chartreuse TITLE=chartreuse>&nbsp;&nbsp;&nbsp;
<TD BGCOLOR=chocolate TITLE=chocolate>&nbsp;&nbsp;&nbsp;
<TR>
<TD BGCOLOR=coral TITLE=coral>&nbsp;&nbsp;
<TD BGCOLOR=cornflower TITLE=cornflower>&nbsp;&nbsp;
<TD BGCOLOR=cornsilk TITLE=cornsilk>&nbsp;&nbsp;
<TD BGCOLOR=crimson TITLE=crimson>&nbsp;&nbsp;
<TD BGCOLOR=cyan TITLE=cyan>&nbsp;&nbsp;
<TD BGCOLOR=darkblue TITLE=darkblue>&nbsp;&nbsp;
<TD BGCOLOR=darkcyan TITLE=darkcyan>&nbsp;&nbsp;
<TD BGCOLOR=darkgoldenrod TITLE=darkgoldenrod>&nbsp;&nbsp;
<TD BGCOLOR=darkgray TITLE=darkgray>&nbsp;&nbsp;
<TD BGCOLOR=darkgreen TITLE=darkgreen>&nbsp;&nbsp;
<TD BGCOLOR=darkkhaki TITLE=darkkhaki>&nbsp;&nbsp;
<TD BGCOLOR=darkmagenta TITLE=darkmagenta>&nbsp;&nbsp;
<TD BGCOLOR=darkolivegreen TITLE=darkolivegreen>&nbsp;&nbsp;
<TD BGCOLOR=darkorange TITLE=darkorange>&nbsp;&nbsp;
<TD BGCOLOR=darkorchid TITLE=darkorchid>&nbsp;&nbsp;
<TD BGCOLOR=darkred TITLE=darkred>&nbsp;&nbsp;
<TR>
<TD BGCOLOR=darksalmon TITLE=darksalmon>&nbsp;&nbsp;
<TD BGCOLOR=darkseagreen TITLE=darkseagreen>&nbsp;&nbsp;
<TD BGCOLOR=darkslateblue TITLE=darkslateblue>&nbsp;&nbsp;
<TD BGCOLOR=darkslategray TITLE=darkslategray>&nbsp;&nbsp;
<TD BGCOLOR=darkturquoise TITLE=darkturquoise>&nbsp;&nbsp;
<TD BGCOLOR=darkviolet TITLE=darkviolet>&nbsp;&nbsp;
<TD BGCOLOR=deeppink TITLE=deeppink>&nbsp;&nbsp;
<TD BGCOLOR=deepskyblue TITLE=deepskyblue>&nbsp;&nbsp;
<TD BGCOLOR=dimgray TITLE=dimgray>&nbsp;&nbsp;
<TD BGCOLOR=dodgerblue TITLE=dodgerblue>&nbsp;&nbsp;
<TD BGCOLOR=firebrick TITLE=firebrick>&nbsp;&nbsp;
<TD BGCOLOR=floralwhite TITLE=floralwhite>&nbsp;&nbsp;
<TD BGCOLOR=forestgreen TITLE=forestgreen>&nbsp;&nbsp;
<TD BGCOLOR=fuchia TITLE=fuchia>&nbsp;&nbsp;
<TD BGCOLOR=gainsboro TITLE=gainsboro>&nbsp;&nbsp;
<TD BGCOLOR=ghostwhite TITLE=ghostwhite>&nbsp;&nbsp;
<TR>
<TD BGCOLOR=gold TITLE=gold>&nbsp;&nbsp;
<TD BGCOLOR=goldenrod TITLE=goldenrod>&nbsp;&nbsp;
<TD BGCOLOR=gray TITLE=gray>&nbsp;&nbsp;
<TD BGCOLOR=green TITLE=green>&nbsp;&nbsp;
<TD BGCOLOR=greenyellow TITLE=greenyellow>&nbsp;&nbsp;
<TD BGCOLOR=honeydew TITLE=honeydew>&nbsp;&nbsp;
<TD BGCOLOR=hotpink TITLE=hotpink>&nbsp;&nbsp;
<TD BGCOLOR=indianred TITLE=indianred>&nbsp;&nbsp;
<TD BGCOLOR=indigo TITLE=indigo>&nbsp;&nbsp;
<TD BGCOLOR=ivory TITLE=ivory>&nbsp;&nbsp;
<TD BGCOLOR=khaki TITLE=khaki>&nbsp;&nbsp;
<TD BGCOLOR=lavender TITLE=lavender>&nbsp;&nbsp;
<TD BGCOLOR=lavenderblush TITLE=lavenderblush>&nbsp;&nbsp;
<TD BGCOLOR=lawngreen TITLE=lawngreen>&nbsp;&nbsp;
<TD BGCOLOR=lemonchiffon TITLE=lemonchiffon>&nbsp;&nbsp;
<TD BGCOLOR=lightblue TITLE=lightblue>&nbsp;&nbsp;
<TR>
<TD BGCOLOR=lightcoral TITLE=lightcoral>&nbsp;&nbsp;
<TD BGCOLOR=lightcyan TITLE=lightcyan>&nbsp;&nbsp;
<TD BGCOLOR=lightgoldenrodyellow TITLE=lightgoldenrodyellow>&nbsp;&nbsp;
<TD BGCOLOR=lightgreen TITLE=lightgreen>&nbsp;&nbsp;
<TD BGCOLOR=lightgrey TITLE=lightgrey>&nbsp;&nbsp;
<TD BGCOLOR=lightpink TITLE=lightpink>&nbsp;&nbsp;
<TD BGCOLOR=lightsalmon TITLE=lightsalmon>&nbsp;&nbsp;
<TD BGCOLOR=lightseagreen TITLE=lightseagreen>&nbsp;&nbsp;
<TD BGCOLOR=lightskyblue TITLE=lightskyblue>&nbsp;&nbsp;
<TD BGCOLOR=lightslategray TITLE=lightslategray>&nbsp;&nbsp;
<TD BGCOLOR=lightsteelblue TITLE=lightsteelblue>&nbsp;&nbsp;
<TD BGCOLOR=lightyellow TITLE=lightyellow>&nbsp;&nbsp;
<TD BGCOLOR=lime TITLE=lime>&nbsp;&nbsp;
<TD BGCOLOR=limegreen TITLE=limegreen>&nbsp;&nbsp;
<TD BGCOLOR=linen TITLE=linen>&nbsp;&nbsp;
<TD BGCOLOR=magenta TITLE=magenta>&nbsp;&nbsp;
<TR>
<TD BGCOLOR=maroon TITLE=maroon>&nbsp;&nbsp;
<TD BGCOLOR=mediumaquamarine TITLE=mediumaquamarine>&nbsp;&nbsp;
<TD BGCOLOR=mediumblue TITLE=mediumblue>&nbsp;&nbsp;
<TD BGCOLOR=mediumorchid TITLE=mediumorchid>&nbsp;&nbsp;
<TD BGCOLOR=mediumpurple TITLE=mediumpurple>&nbsp;&nbsp;
<TD BGCOLOR=mediumseagreen TITLE=mediumseagreen>&nbsp;&nbsp;
<TD BGCOLOR=mediumslateblue TITLE=mediumslateblue>&nbsp;&nbsp;
<TD BGCOLOR=mediumspringgreen TITLE=mediumspringgreen>&nbsp;&nbsp;
<TD BGCOLOR=mediumturquoise TITLE=mediumturquoise>&nbsp;&nbsp;
<TD BGCOLOR=mediumvioletred TITLE=mediumvioletred>&nbsp;&nbsp;
<TD BGCOLOR=midnightblue TITLE=midnightblue>&nbsp;&nbsp;
<TD BGCOLOR=mintcream TITLE=mintcream>&nbsp;&nbsp;
<TD BGCOLOR=mistyrose TITLE=mistyrose>&nbsp;&nbsp;
<TD BGCOLOR=moccasin TITLE=moccasin>&nbsp;&nbsp;
<TD BGCOLOR=navajowhite TITLE=navajowhite>&nbsp;&nbsp;
<TD BGCOLOR=navy TITLE=navy>&nbsp;&nbsp;
<TR>
<TD BGCOLOR=oldlace TITLE=oldlace>&nbsp;&nbsp;
<TD BGCOLOR=olive TITLE=olive>&nbsp;&nbsp;
<TD BGCOLOR=olivedrab TITLE=olivedrab>&nbsp;&nbsp;
<TD BGCOLOR=orange TITLE=orange>&nbsp;&nbsp;
<TD BGCOLOR=orangered TITLE=orangered>&nbsp;&nbsp;
<TD BGCOLOR=orchid TITLE=orchid>&nbsp;&nbsp;
<TD BGCOLOR=palegoldenrod TITLE=palegoldenrod>&nbsp;&nbsp;
<TD BGCOLOR=palegreen TITLE=palegreen>&nbsp;&nbsp;
<TD BGCOLOR=paleturquoise TITLE=paleturquoise>&nbsp;&nbsp;
<TD BGCOLOR=palevioletred TITLE=palevioletred>&nbsp;&nbsp;
<TD BGCOLOR=papayawhip TITLE=papayawhip>&nbsp;&nbsp;
<TD BGCOLOR=peachpuff TITLE=peachpuff>&nbsp;&nbsp;
<TD BGCOLOR=peru TITLE=peru>&nbsp;&nbsp;
<TD BGCOLOR=pink TITLE=pink>&nbsp;&nbsp;
<TD BGCOLOR=plum TITLE=plum>&nbsp;&nbsp;
<TD BGCOLOR=powderblue TITLE=powderblue>&nbsp;&nbsp;
<TR>
<TD BGCOLOR=purple TITLE=purple>&nbsp;&nbsp;
<TD BGCOLOR=red TITLE=red>&nbsp;&nbsp;
<TD BGCOLOR=rosybrown TITLE=rosybrown>&nbsp;&nbsp;
<TD BGCOLOR=royalblue TITLE=royalblue>&nbsp;&nbsp;
<TD BGCOLOR=saddlebrown TITLE=saddlebrown>&nbsp;&nbsp;
<TD BGCOLOR=salmon TITLE=salmon>&nbsp;&nbsp;
<TD BGCOLOR=sandybrown TITLE=sandybrown>&nbsp;&nbsp;
<TD BGCOLOR=seagreen TITLE=seagreen>&nbsp;&nbsp;
<TD BGCOLOR=seashell TITLE=seashell>&nbsp;&nbsp;
<TD BGCOLOR=sienna TITLE=sienna>&nbsp;&nbsp;
<TD BGCOLOR=silver TITLE=silver>&nbsp;&nbsp;
<TD BGCOLOR=skyblue TITLE=skyblue>&nbsp;&nbsp;
<TD BGCOLOR=slateblue TITLE=slateblue>&nbsp;&nbsp;
<TD BGCOLOR=slategray TITLE=slategray>&nbsp;&nbsp;
<TD BGCOLOR=snow TITLE=snow>&nbsp;&nbsp;
<TD BGCOLOR=springgreen TITLE=springgreen>&nbsp;&nbsp;
<TR>
<TD BGCOLOR=steelblue TITLE=steelblue>&nbsp;&nbsp;
<TD BGCOLOR=tan TITLE=tan>&nbsp;&nbsp;
<TD BGCOLOR=teal TITLE=teal>&nbsp;&nbsp;
<TD BGCOLOR=thistle TITLE=thistle>&nbsp;&nbsp;
<TD BGCOLOR=tomato TITLE=tomato>&nbsp;&nbsp;
<TD BGCOLOR=turquoise TITLE=turquoise>&nbsp;&nbsp;
<TD BGCOLOR=violet TITLE=violet>&nbsp;&nbsp;
<TD BGCOLOR=wheat TITLE=wheat>&nbsp;&nbsp;
<TD BGCOLOR=white TITLE=white>&nbsp;&nbsp;
<TD BGCOLOR=whitesmoke TITLE=whitesmoke>&nbsp;&nbsp;
<TD BGCOLOR=yellow TITLE=yellow>&nbsp;&nbsp;
<TD BGCOLOR=yellowgreen TITLE=yellowgreen>&nbsp;&nbsp;
</TABLE>

<P>
<LABEL FOR=SelColor>Farve:</LABEL>
<INPUT TYPE=TEXT SIZE=20 ID=SelColor>
<BR>
<SPAN ID=RGB>&nbsp;</SPAN>

<P>
<BUTTON ID=Ok TYPE=SUBMIT>OK</BUTTON>
<BUTTON ONCLICK="window.close();">Annuller</BUTTON>

</BODY>
</HTML>

så skal du bare skrive:

<form name="f"><input type="button" value="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" name="farve" style="background-color:#FFFFFF" onclick="window.open('selcolor.asp')"/></form>

i opener-vinduet.
Avatar billede dkkarpen Nybegynder
10. juli 2002 - 13:56 #8
Det virker ikke rigtigt for mig. Svarer detderskalfarves_id til navnet eller id på min inputknap jeg ønsker farvet?
Avatar billede mikoalngelo Nybegynder
10. juli 2002 - 13:59 #9
Navnet, men bare glem det, det virker ikke, jeg havde ikke testet det. Sorry.
Avatar billede dkkarpen Nybegynder
10. juli 2002 - 14:01 #10
=maddog=>>Det virker ikke rigtigt for mig. Svarer detderskalfarves_id til navnet eller id på min inputknap jeg ønsker farvet?
Avatar billede =maddog= Nybegynder
10. juli 2002 - 14:11 #11
dkkarpen> ja det gør.
Avatar billede dkkarpen Nybegynder
10. juli 2002 - 14:16 #12
Så virker det ikke.
Avatar billede dkkarpen Nybegynder
10. juli 2002 - 14:16 #13
Har du selv testet det?
Avatar billede =maddog= Nybegynder
10. juli 2002 - 14:36 #14
ikke på dit konkrete eksempel, men det gør jeg så. øjeblik. (det er også en del points. det fortjener en ordentlig dbug)
Avatar billede =maddog= Nybegynder
10. juli 2002 - 14:44 #15
ok du skal slette
<SCRIPT LANGUAGE=JavaScript FOR=Ok EVENT=onclick>
  window.returnValue = SelColor.value;
  window.close();
</SCRIPT>
jeg oploader lige et eksempel
Avatar billede =maddog= Nybegynder
10. juli 2002 - 14:45 #16
Avatar billede =maddog= Nybegynder
10. juli 2002 - 14:48 #17
løgn! du skal slette:
<SCRIPT LANGUAGE=JavaScript FOR=Ok EVENT=onclick>
  window.opener.forms['f'].elements['farve'].style.backgroundColor = SelColor.value;
  window.close();
</SCRIPT>

ikke den anden!!!!!!!!!!
Avatar billede dkkarpen Nybegynder
10. juli 2002 - 15:26 #18
Tak for det ;-)
Avatar billede =maddog= Nybegynder
10. juli 2002 - 15:40 #19
no problemos. jeg må indrømme at jeg overså at der i forvejen var defineret et onclick på den knap. jeg er vant til NS kompatibel kode så de der event definerende scripts fløj lige forbi mig uden at blive ordentligt gennemset.
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester