Hi is there anyone to help me ...? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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?

2nd Sep 2018, 12:52 PM
Kimiya Nayyeri
Kimiya Nayyeri - avatar
2 Answers
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 :)
3rd Sep 2018, 6:38 AM
Sam Pache
Sam Pache - avatar
0
I don't want to show the size in alert.i want to show the size in this url ... url ="nextpage.php? size="
4th Sep 2018, 3:50 AM
Kimiya Nayyeri
Kimiya Nayyeri - avatar