[Javascript] Content Manager
Troy III Ajnej
trojani2000 at hotmail.com
Thu Aug 10 15:18:25 CDT 2006
Hello Tedd,
(This Sounds like HAL - in "Space Odyssey" )
Replace the <p> <a heref=... code for "save" & "edit" html
in the following page of yours: ../ajax_pargraph1/ with this:
<pre><div id="tgl">Edit</div><img id="swtch" src="d_arrow.gif"></pre>Apply this script at the bottom of document body:
<script type="text/javascript">
var tgl = document.getElementById("tgl") var swtch = document.getElementById("swtch")function EditSave(){ if(tgl.innerHTML!="Save"){ tgl.innerHTML="Save"; swtch.src="r_arrow.gif"; EditSection('Requirements'); } else{ tgl.innerHTML="Edit"; swtch.src="d_arrow.gif"; sndReqArg('four', txtRequirements.value); ViewSection('Requirements'); } }swtch.onclick=EditSavetgl.onclick=EditSave
</script>
*In case you don't like the Edit/Save text to show, place this inside the style:
#tgl{display:none}
eventhough I suggest you leave it, -the arrow alone is not intuitive enough.
>>>
explication:
We are using innerHTML because of the simplicity and because of the controversial fact
that it is more widely supported than the W3C method.
I've wrapped the "div" in "pre" for esthetical reasons only, so that edit and save would take
exactly the same space when switched.
***
Test this and give us feedback.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Troy III progressive art enterprise~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_________________________________________________________________
Try Live.com - your fast, personalized homepage with all the things you care about in one place.
http://www.live.com/getstarted
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20060810/54a9e73d/attachment.htm>
More information about the Javascript
mailing list