• Hi,
    I hope this is the right place .
    I write to my template Page Options
    I wanted to know if I put something in , for example, an image I want to have a button next to it
    ” delete ” when pressed would then jump Alert

    If you click OK so I want to do
    delete_option command
    If not do not do anything .

    I gave onclick=”validate_delete” to delete
    The problem that I do not know how to turn the OK from the popup to delete_option command..
    ( <?php delete_option( $option ); ?> )

    Thank you

Viewing 4 replies - 1 through 4 (of 4 total)
  • Richard

    (@richardcoffee)

    Thread Starter guymizrahi

    (@guymizrahi)

    thanks for answer,
    yeah, i succsess in getting the onClick event.
    i did some alert or something.
    but the problem is that I Cant use PHP code ( delete_option )
    in Js file.. so how i actually gonna use delete_option?

    thanks.

    Richard

    (@richardcoffee)

    This would need to be handled using a two part method.

    First part is deleting the image actually being viewed. Use javascript to find and remove it in the DOM. All this will do is remove it from the screen, giving the user the impression the image has been deleted.

    Second part is actually deleting the image. You can achieve this using both javascript and php. When removing the image from the screen, you will need to save an image identifier in a hidden field that gets sent back to the server when the page is saved. In the server php code, check if the field has data and process that data to actually delete the image.

    Hope this helps

    Thread Starter guymizrahi

    (@guymizrahi)

    thanks alot ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘delete_option with button?’ is closed to new replies.