Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8830679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:09:01+00:00 2026-06-14T08:09:01+00:00

PHP $output_string .= ‘<td><button id=changeButton type=button onclick=deleteAdress(‘. $row[‘adresses_id’] .’, ‘. $row[‘adresses_street’] .’);>Ta bort</button></td>’; Javascript

  • 0

PHP

$output_string .= '<td><button id="changeButton" type="button" onclick="deleteAdress('. $row['adresses_id'] .', "'. $row['adresses_street'] .'");">Ta bort</button></td>';

Javascript

function deleteAdress(adressID, adressStreetName) {   

    alert(adressID);

}

I’m trying to create a button in php with onclick should make an alert box (for now). When i send numbers it works. But when one string contains text i stops working. Nothing. No alert box at all. I have also tried without the double quotes.

If you can see any problem please tell me. 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T08:09:03+00:00Added an answer on June 14, 2026 at 8:09 am

    Need to add escaped quotes

    $output_string .= '<td><button id="changeButton" type="button" onclick="deleteAdress(\''. htmlspecialchars($row['adresses_id'], ENT_QUOTES) .'\', \''. htmlspecialchars($row['adresses_street'], ENT_QUOTES) .'\');">Ta bort</button></td>';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I trying to find function in PHP that can output the binary data. The
I want to convert this code into PHP, it's a function that hides layers
Which php array function should be used to match a string to the first
xss.php <?php header('Content-Type:text/html; charset=UTF-8'); var_dump(ini_get('filter.default')); if (isset($_GET['name'])) { echo $_GET['name']; exit(); } browsing http://localhost/xss.php?name=%3Cscript%3Ealert('XSS')%3C/script%3E
The PHP tidy extension has a function ob_tidyhandler Docs that works with PHP output
Before PHP 5.3.3 the following class Same { public function same() { echo 'Not
I've got the following Php script: <?php function filt($k, $l){ if($k===$l){ var_dump(valid: .$k.-.$l); return
I use the filter_var PHP function to validate email address when a user signs
I tried PHP's built-in function: filter_input() var_dump(filter_var('john.doe.@gmail.com', FILTER_VALIDATE_EMAIL)); Output: string(19) john.doe.@gmail.com Then I tried
I want to output the following string in PHP: ä ö ü ß €

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.