I remember passing over a site that had a tutorial how to do this, but I didn't think much of it at the time and now I can't find it...hopefully someone here can point me in the right direction.
I have created a small table using <div>'s some of these I would like to give the user the abilty to edit/add text.
since the contenteditable attribute is not entirly "cross-browser", I was looking for an alternate approach.
This is what I would like to do:
HTML something like this:
<script src="editDiv.js" type="text/javascript"></script>
<div class="nameBox" id="fName" onclick="edit(this)"></div>
<div class="addBox" id="add" onclick="edit(this)"></div>
now the JavaScript is where I have the issues (although I think it should be stright forward)...
I would like my editDiv.js file to:
A: generate a popup with a text field.
B: once the user clicks "OK" the content of the textbox is placed in the appropriate <div> (using innerHTML)
I'm sure this is possible...
Any thoughts would be greatly appreciated.
Thanks,
AtSea
I have created a small table using <div>'s some of these I would like to give the user the abilty to edit/add text.
since the contenteditable attribute is not entirly "cross-browser", I was looking for an alternate approach.
This is what I would like to do:
HTML something like this:
<script src="editDiv.js" type="text/javascript"></script>
<div class="nameBox" id="fName" onclick="edit(this)"></div>
<div class="addBox" id="add" onclick="edit(this)"></div>
now the JavaScript is where I have the issues (although I think it should be stright forward)...
I would like my editDiv.js file to:
A: generate a popup with a text field.
B: once the user clicks "OK" the content of the textbox is placed in the appropriate <div> (using innerHTML)
I'm sure this is possible...
Any thoughts would be greatly appreciated.
Thanks,
AtSea