0
Hi is there anyone to help me ...?
the code inmyprofile has a prblem.i want to send the value from dropdownlist to other page I used javascript to get that selected value and show it at a modal first then it shows on second page var url="nextpage.php?size=" .there ia a tag in my modal with href=javascript:Window. location=url" it give us none.on the second page $_GET ("size");.can you help me?
2 Respuestas
0
Delete your JavaScript and your CSS and here is your new HTML :
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script>
function val() {
d = document.getElementById("comboBox").value;
alert(d);
}
</script>
</head>
<body>
<form method="get" id="find" action="nextpage.php">
<select name="size" id="comboBox" onchange="val()">
<option value="xs" selected>xs</option>
<option value="s">s</option>
<option value="m">m</option>
</select>
</form>
<button type="submit" value"submit" data-target="#mymodal1" data-toggle="modal" > >add</button>
<div class="modal fade" id="mymodal1" role="dialog" data-toggle="modal" data-target="#mymodal1">
<a href="javascript:window.location=url"></a>
</div>
</body>
</html>
Whenever your combobox has a change, it calls the function val(), this function returns the selected value in an alert (actually).
From that var, you can do whatever your want with your "size" var that I didn't really understand but I suppose you'll be fine by now, Enjoy :)
0
I don't want to show the size in alert.i want to show the size in this url ...
url ="nextpage.php? size="