1

I need an event to occur that when the text of $name is changed the new value of $name is updated into the database. I've looked at examples online but can't find any that use PHP which I'm planning on using to create the SQL statement in the database.

I've tried using the solution found here to even get a console.log printing but doesn't seem to be triggering for me. trigger an event when contenteditable is changed

Only part of the link is allowed to be changed hence why I'm using an inner span tag.

<a href='/tool/model/viewPackage.php?packageId=".$row_prim['id']."&prim=" . $prim ."'>" . $component_name . " " . "<span class='changeable' contenteditable='true' style='white-space:nowrap'>"  . $name . "</span></a>"; 
Community
  • 1
  • 1
olliejjc16
  • 361
  • 5
  • 20

1 Answers1

0

You can't use PHP to do anything dynamic with webpages - it's a server side language. You can use javascript/jQuery to send an ajax request to a page every x seconds and if it's changed change the value in the a tag.

Daniel
  • 1,229
  • 14
  • 24