I want to have a text field appear when somebody clicks a link. I have researched this to end but nothing seems to quite work. Here is what I have so far:
<span id="location_field_index">
<a href="javascript:void(0)" onclick="innerHTML=\"<input type=\"text\" name=\"update_location\" value=\"<? echo $location_string; ?>\"" >
<?php echo $location_string; ?>
</a>
</span>
I realize this is probably so far wrong, but any help would be nice.
You seem to be mixing php with javascript. For a pure javascript solution you need to create a function that you want to be called on click like so
function ClickFunction()then inside you are going to want to get the element of the location usingDocument.getElementById('location_field_index'). Then you want to set the innerhtml attribute. The following should do itThen inside the link add
<a onclick="addBlock()">Click ME<a>