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

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -