Selecteren en schuiven

Overzicht Reageren

Sponsored by: Vacatures door Monsterboard

Ed Wisseborn

Ed Wisseborn

06/07/2008 11:46:00
Quote Anchor link
Hallo luitjes, wil het volgende:
Heb 2 vakken. Links aan aantal namen. Rechts is leeg. 3 knoppen met linker en rechter pijl en verzenden. Nu kan de gebruiker een naam selecteren en op pijl klikken en dan zou de naam naar rechts moeten in een nieuwe lijst. Ook kan hij de naam weer naar links verplaatsen. Na knop verzenden komt een controle.
Wie heeft een voorzet hoe dit te doen in PHP?
 
PHP hulp

PHP hulp

25/04/2024 21:42:28
 
Crispijn -

Crispijn -

06/07/2008 11:48:00
Quote Anchor link
In eerste instantie heb je iets javascript achtigs nodig dat het netjes van het ene naar het andere vak veranderd. Het php controle verhaal komt daarna pas. :)
 
Ed Wisseborn

Ed Wisseborn

06/07/2008 11:53:00
Quote Anchor link
Ergens een klein voorbeeld te vinden. Ben niet echt bekend met Java
 
Robert Deiman

Robert Deiman

06/07/2008 12:19:00
 
Crispijn -

Crispijn -

06/07/2008 12:20:00
Quote Anchor link
Het is javascript he, dat is weer totaal anders dan java :)
 
Ed Wisseborn

Ed Wisseborn

06/07/2008 13:05:00
Quote Anchor link
Ja dat bedoel ik. Merci voor de reacties
 
Ed Wisseborn

Ed Wisseborn

08/07/2008 22:20:00
Quote Anchor link
Heb nu het volgende maar moet natuurlijk de keuze's meenemen naar volgende pagina maar dan met PHP. Wie heeft een idee?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function moveOver()
{
var boxLength = document.choiceForm.choiceBox.length;
var selectedItem = document.choiceForm.available.selectedIndex;
var selectedText = document.choiceForm.available.options[selectedItem].text;
var selectedValue = document.choiceForm.available.options[selectedItem].value;
var i;
var isNew = true;
if (boxLength != 0) {
for (i = 0; i < boxLength; i++) {
thisitem = document.choiceForm.choiceBox.options.text;
if (thisitem == selectedText) {
isNew = false;
break;
}
}
}
if (isNew) {
newoption = new Option(selectedText, selectedValue, false, false);
document.choiceForm.choiceBox.options[boxLength] = newoption;
}
document.choiceForm.available.selectedIndex=-1;
}
function removeMe() {
var boxLength = document.choiceForm.choiceBox.length;
arrSelected = new Array();
var count = 0;
for (i = 0; i < boxLength; i++) {
if (document.choiceForm.choiceBox.options.selected) {
arrSelected[count] = document.choiceForm.choiceBox.options.value;
}
count++;
}
var x;
for (i = 0; i < boxLength; i++) {
for (x = 0; x < arrSelected.length; x++) {
if (document.choiceForm.choiceBox.options.value == arrSelected[x]) {
document.choiceForm.choiceBox.options = null;
}
}
boxLength = document.choiceForm.choiceBox.length;
}
}
function saveMe() {
var strValues = "";
var boxLength = document.choiceForm.choiceBox.length;
var count = 0;
if (boxLength != 0) {
for (i = 0; i < boxLength; i++) {
if (count == 0) {
strValues = document.choiceForm.choiceBox.options.value;
}
else {
strValues = strValues + "," + document.choiceForm.choiceBox.options.value;
}
count++;
}
}
}
// End -->
</script>
</head>
<body>
<center>
<form name="choiceForm">
<select name="available" size=10 onchange="moveOver();">
<option value=1>Keuze 1
<option value=2>Keuze 2
<option value=3>Keuze 3
<option value=4>Keuze 4
<option value=5>Keuze 5
<option value=6>Keuze 6
<option value=7>Keuze 7
<option value=8>Keuze 8
<option value=9>Keuze 9
<option value=10>Keuze 10
</select>
&nbsp;&nbsp;&nbsp;&nbsp;
<select multiple name="choiceBox" style="width:150;" size="10">
</select>
</center>
<br />
</form><br />
<center><input type="button" value="Verwijder" onclick="removeMe();"></center>
</body>
</html>
 
Jan Koehoorn

Jan Koehoorn

08/07/2008 22:41:00
Quote Anchor link
Zo:
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function moveOver()
{
var boxLength = document.choiceForm.choiceBox.length;
var selectedItem = document.choiceForm.available.selectedIndex;
var selectedText = document.choiceForm.available.options[selectedItem].text;
var selectedValue = document.choiceForm.available.options[selectedItem].value;
var i;
var isNew = true;
if (boxLength != 0) {
for (i = 0; i < boxLength; i++) {
thisitem = document.choiceForm.choiceBox.options.text;
if (thisitem == selectedText) {
isNew = false;
break;
}
}
}
if (isNew) {
newoption = new Option(selectedText, selectedValue, false, false);
document.choiceForm.choiceBox.options[boxLength] = newoption;
}
document.choiceForm.available.selectedIndex=-1;
}
function removeMe() {
var boxLength = document.choiceForm.choiceBox.length;
arrSelected = new Array();
var count = 0;
for (i = 0; i < boxLength; i++) {
if (document.choiceForm.choiceBox.options[i].selected) {
arrSelected[count] = document.choiceForm.choiceBox.options[i].value;
}
count++;
}
var x;
for (i = 0; i < boxLength; i++) {
for (x = 0; x < arrSelected.length; x++) {
if (document.choiceForm.choiceBox.options[i].value == arrSelected[x]) {
document.choiceForm.choiceBox.options[i] = null;
}
}
boxLength = document.choiceForm.choiceBox.length;
}
}
function saveMe() {
var strValues = "";
var boxLength = document.choiceForm.choiceBox.length;
var count = 0;
if (boxLength != 0) {
for (i = 0; i < boxLength; i++) {
if (count == 0) {
strValues = document.choiceForm.choiceBox.options[i].value;
}
else {
strValues = strValues + "," + document.choiceForm.choiceBox.options[i].value;
}
count++;
}
}
}
// End -->
</script>
</head>
<body>
<center>
<form name="choiceForm" method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
<p>
    <input type="submit" value="verzenden" />
</p>
<select name="available" size=10 onchange="moveOver();">
<option value=1>Keuze 1
<option value=2>Keuze 2
<option value=3>Keuze 3
<option value=4>Keuze 4
<option value=5>Keuze 5
<option value=6>Keuze 6
<option value=7>Keuze 7
<option value=8>Keuze 8
<option value=9>Keuze 9
<option value=10>Keuze 10
</select>
&nbsp;&nbsp;&nbsp;&nbsp;
<select multiple id="choiceBox" name="choiceBox[]" style="width:150;" size="10">
</select>
</center>
<br />
</form><br />
<center><input type="button" value="Verwijder" onclick="removeMe();"></center>
<?php
    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
        echo '<pre>' . print_r ($_POST, true) . '</pre>';    
    }

?>

</body>
</html>
 
Ed Wisseborn

Ed Wisseborn

08/07/2008 23:14:00
Quote Anchor link
Merci Jan maar geprbeerd en doet het niet. Kan de pagina niet vinden i.p.v printen
Gewijzigd op 01/01/1970 01:00:00 door Ed Wisseborn
 
Ed Wisseborn

Ed Wisseborn

09/07/2008 21:56:00
Quote Anchor link
Zou je nog eens kunnen kijken Jan? $_SERVER['REQUEST_URI'] ken ik trouwens niet.
Bumpen::
Twee of meer keer achter elkaar in een topic posten heet bumpen. Bumpen is pas na 24 uur toegestaan en kan een reden zijn voor de admins en moderators om een topic te sluiten. Gebruik indien nodig de Afbeelding knop om je tekst aan te passen.
Gewijzigd op 01/01/1970 01:00:00 door Ed Wisseborn
 
Emmanuel Delay

Emmanuel Delay

10/07/2008 12:32:00
Quote Anchor link
Kijk hier eens even:

http://be.php.net/manual/en/reserved.variables.server.php
(voor die $_SERVER['REQUEST_URI'])
Gewijzigd op 01/01/1970 01:00:00 door Emmanuel Delay
 
Ed Wisseborn

Ed Wisseborn

10/07/2008 17:25:00
Quote Anchor link
Merci emmanuel maar was er al mee bezig. W.b.t dat bumpen, beetje kinderachtig om op een uur te kijken.
 
Robert Deiman

Robert Deiman

10/07/2008 18:49:00
Quote Anchor link
Ed Wisseborn schreef op 10.07.2008 17:25:
Merci emmanuel maar was er al mee bezig. W.b.t dat bumpen, beetje kinderachtig om op een uur te kijken.


Ook 1 uur te vroeg, is te vroeg. Als we gaan beginnen de regels "met een korreltje zout" te nemen, dan is het einde snel zoek..
 
Ed Wisseborn

Ed Wisseborn

10/07/2008 19:09:00
Quote Anchor link
Zoals ik al zei maar dan val ik herhaling. Sluit dit topic maar.

Groetjes, Edje
 



Overzicht Reageren

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.