PHP interesse |
|
Hey ik heb dus bijvoorbeeld een nieuws systeem.
Als ik vlaggetjes wil toevoegen moet ik dus
vlag drukken en dan komt er een popup... in die popup staan de vlaggetjes... maar dan komt het probleem... als ik er 1 aan klikt zet die ze allemaal in het form... ik weet niet hoe ik het moet oplossen.
Kan iemand mij helpen?
Dit is de code die ik gebruikt (javascript) ik heb het in php gedaan omdat ik met meerdere forms werkt. Dat werkt ook trouwens. Het gaat puur omdat als ik bijv 1 aan klikt dat die dan allemaal er in zet en dat moet niet, alleen die ene die je aan klikt.
<?
} else {
echo "<script>";
echo "function popupinser(){";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':ALB:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':AND:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':ARG:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':AUS:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':AUST:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':BR:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':BEL:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':BOL:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':BH:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':BRA:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':BUL:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':CAN:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':CAR:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':CHIL:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':CHI:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':COL:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':CRO:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':CYP:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':CR:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':DEN:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':DK:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':EST:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':EURO:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':FI:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':FIN:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':FRC:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':GER:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':ICE:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':HUN:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':IND:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':INDO:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':INTER:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':IRAN:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':IRAQ:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':IRE:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':ISR:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':ITY:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':JAP:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':KAZ:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':KOR:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':LAT:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':LS:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':LIT:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':LUX:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':MAC:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':MAL:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':MALT:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':MEX:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':MOL:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':MON:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':MOR:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':NED:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':NZ:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':NOR:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':PER:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':PHIL:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':POL:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':POR:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':ROM:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':RF:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':SM:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':SIN:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':SR:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':SLO:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':SA:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':SPA:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':SWE:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':SWI:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':SYR:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':TAI:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':TIB:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':TUN:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':TUR:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':UKR:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':UK:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':URU:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':USA:';";
echo "opener.document.forms['cmsform'].elements['$type'].value += ':VEN:';";
echo "}";
echo "</script>";
?>
Dit is de code die ik gebruikt (javascript) ik heb het in php gedaan omdat ik met meerdere forms werkt. Dat werkt ook trouwens. Het gaat puur omdat als ik bijv 1 aan klikt dat die dan allemaal er in zet en dat moet niet, alleen die ene die je aan klikt. <? } else { echo "function popupinser(){"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':ALB:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':AND:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':ARG:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':AUS:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':AUST:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':BR:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':BEL:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':BOL:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':BH:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':BRA:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':BUL:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':CAN:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':CAR:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':CHIL:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':CHI:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':COL:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':CRO:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':CYP:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':CR:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':DEN:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':DK:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':EST:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':EURO:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':FI:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':FIN:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':FRC:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':GER:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':ICE:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':HUN:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':IND:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':INDO:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':INTER:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':IRAN:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':IRAQ:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':IRE:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':ISR:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':ITY:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':JAP:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':KAZ:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':KOR:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':LAT:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':LS:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':LIT:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':LUX:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':MAC:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':MAL:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':MALT:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':MEX:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':MOL:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':MON:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':MOR:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':NED:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':NZ:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':NOR:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':PER:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':PHIL:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':POL:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':POR:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':ROM:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':RF:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':SM:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':SIN:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':SR:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':SLO:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':SA:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':SPA:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':SWE:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':SWI:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':SYR:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':TAI:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':TIB:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':TUN:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':TUR:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':UKR:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':UK:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':URU:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':USA:';"; echo "opener.document.forms['cmsform'].elements['$type'].value += ':VEN:';"; ?>
En dan nu me html
Dit heb ik natuurlijk voor alle landen...
<a href="javascript:popupinser(':ALB:');"><img src="images/flags/Albania.gif" border="0"></a>
Dit heb ik natuurlijk voor alle landen... <a href="javascript:popupinser(':ALB:');"><img src="images/flags/Albania.gif" border="0"></a>
Alvast bedankt voor u reactie!
|