robert_gsfame Posted September 28, 2009 Share Posted September 28, 2009 i don't have any idea at all about javascript but i need it so much, can anyone help me? I would like to have 2 buttons in one form, first button will be used to execute this <form action=page1.php> while the second button i will use to jump and execute whatever script written in page2.php I know that i need to use getElementById....but i don't know how to do it, and how to pass the value into page2.php...let say i have $id=$_GET['id']; then i want to pass this to page2.php, how can i do it using JS. detail explanation would help a lot, thx in advance Link to comment https://forums.phpfreaks.com/topic/175800-solved-documentgetelementbyid-problem/ Share on other sites More sharing options...
robert_gsfame Posted September 28, 2009 Author Share Posted September 28, 2009 okay i got what i want...i don't know whether this is correct or not but it works $id=$_GET['id']; <script type="text/javascript" language="javascript"> function _func1(){ parameter = document.getElementById("value1").value window.location="page1.php?id=<?php echo $id;?>&myparameter=" + parameter;} </script> <input type="text" id="value1"> <input type=button onclick=_func1()> Is something missing ?? or this is correct? Link to comment https://forums.phpfreaks.com/topic/175800-solved-documentgetelementbyid-problem/#findComment-926380 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.