Is it possible to save radio buttons appended by javascript?

I am trying to append some radio button fields in meta box content. However, when I try to save it into my database it does nothing.

$(“#result”).append(“<input
style=’display:inline-block !important;
margin-top:-152px !important;’
type=’radio’
name=’resimsecimi’
value='”+imageURL+”‘>
<img width=’180px’height=’180px’ id='”+ say +”” src='” + imageURL + “‘ /><br>”);

And here you can see my code for saving this meta box data

function ozelalankutucuk_kaydet ($post_id) {

if (! isset( $_POST[‘ozelalankutucuk_nonce’])) {
return;
}

if (! wp_verify_nonce( $_POST[‘ozelalankutucuk_nonce’], ‘ozelalankutucuk_kaydet’ ) ) {
return;
}

if (! current_user_can( ‘edit_post’, $post_id )) {
return;
}
if (! isset( $_POST[‘resimsecimi’])) {
return;
}

// Update the meta field in the database.
update_post_meta( $post_id, ‘_ozelalan_key’, $_POST[‘resimsecimi’] );

}

Read more here:: Is it possible to save radio buttons appended by javascript?

Leave a Reply

Your email address will not be published. Required fields are marked *