Reputation: 27
Please help, This is what I am using.
$('#upload-image-form<?php echo json_encode($row['id']); ?>).on('submit', function(e) {some javascript code};
This is what I am getting(view page source)
$('#upload-image-form"475").on('submit', function(e) {some javascript code}
And this is what I want(view page source)
$('#upload-image-form475).on('submit', function(e) {some javascript code}
Upvotes: 0
Views: 56
Reputation: 72269
No need of json_encode()
here.
Just Change :-
$('#upload-image-form<?php echo json_encode($row['id']); ?>)
to
$('#upload-image-form<?php echo $row["id"]; ?>')
Note:- You missed single quote in end in your original code
Upvotes: 2