stijn0713 Posted June 22, 2012 Share Posted June 22, 2012 I hava an input file. In there, they select e.g. 5 and then 5 inputfields appear. I generate them in a javascript with an onchange event on the select element. But now i wonder how i have to collect these inputs in the php script? If you have defined fields you can pass them via $_POST with the action element, now i'm a little confused Link to comment https://forums.phpfreaks.com/topic/264628-passing-variables-to-script/ Share on other sites More sharing options...
xyph Posted June 22, 2012 Share Posted June 22, 2012 You can use JavaScript to post those values to an external PHP file. Link to comment https://forums.phpfreaks.com/topic/264628-passing-variables-to-script/#findComment-1356232 Share on other sites More sharing options...
stijn0713 Posted June 22, 2012 Author Share Posted June 22, 2012 Ok, but that's very brief explanation. How should i do that? Link to comment https://forums.phpfreaks.com/topic/264628-passing-variables-to-script/#findComment-1356245 Share on other sites More sharing options...
xyph Posted June 22, 2012 Share Posted June 22, 2012 It was a very brief question. You should use AJAX if you don't want the user to go to the posting page. You should use submit the form otherwise. Any changes made via JavaScript should be posted along with it. JavaScript can create a POST request, and it's well documented. Link to comment https://forums.phpfreaks.com/topic/264628-passing-variables-to-script/#findComment-1356250 Share on other sites More sharing options...
stijn0713 Posted June 22, 2012 Author Share Posted June 22, 2012 Ok, ill do some more research then. Link to comment https://forums.phpfreaks.com/topic/264628-passing-variables-to-script/#findComment-1356253 Share on other sites More sharing options...
xyph Posted June 22, 2012 Share Posted June 22, 2012 Perfect, when you have a specific issue please post back. As of now, you're asking a very broad question that has more to do with client-server interaction than PHP itself Link to comment https://forums.phpfreaks.com/topic/264628-passing-variables-to-script/#findComment-1356259 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.