how to remove double inverted commas when calling php row value on javascript -


please help, using.

$('#upload-image-form<?php echo json_encode($row['id']); ?>).on('submit', function(e) {some javascript code}; 

this getting(view page source)

$('#upload-image-form"475").on('submit', function(e) {some javascript code} 

and want(view page source)

$('#upload-image-form475).on('submit', function(e) {some javascript code} 

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:- missed single quote in end in original code


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -