I need to store some variable which I can extract from javascript and later need to use on php when submit the form.
So I have created input field on html like
HTML
<input type="hidden" name="videoname_var" id="videoname_var" method="get"/>
And on init I have set the value of this input from java script
JS
document.getElementById("videoname_var").value = VIDEO_NAME_;
And later on submit, from php I am accessing the value like,
$videoname = $_GET['videoname_var'];
But the value of $videoname is always null,
Anything wrong on this approach?.
Edit:
Here is the from,
<form id=form_id enctype="multipart/form-data" encoding='multipart/form-data' method='post' >
<input class=" button1" type="submit" name="Submit" value="Upload">
<input type="hidden" name="videoname_var" id="videoname_var" />
</form>
And I am setting the value from java script $(document).ready() like
document.getElementById("videoname_var").value = VIDEO_NAME_;
And at on submit button click
This php was executing
if (isset($_FILES['file']))
{
$videoname = $_GET['videoname_var'];
}