I have a form and want to pass a value from it to my javascript - and use this value to create a javascript variable.
Im a newbie at javascript and cant get it to work.
Here is my code:
<input id="bartype" name="bartype" type="text" value="<?php echo $bartype; ?>" style="display:none" />
I want to grab the value and in my javascript create this var:
var type = $('#bartype');
var targetUrl = 'listing.php?page=$'+type;
How do I do this?
Thanks a lot