I am attempting to add the action attribute to my form element, on the load of a jquery function. However, I seem to be missing something. I have tried searching for this issue, and I have not found any luck in regards to my issue. Here is the HTML in question:
<form method="post" enctype="multipart/form-data" id="#photouploader">
Upload Client Photo Here
<input type="file" name="thumbnail">
<input type="submit" value="Upload Image">
</form>
This is the Jquery function I wrote:
$(document).ready(function(){
var id = document.location.href.split('client/')[1];
$('#photouploader').attr('action', '/form-upload/'+id);
});
I am just looking to understand where I am going wrong here.