Results 1 to 2 of 2

Thread: Why is this code not working???

  1. #1
    Join Date
    Dec 2004

    Why is this code not working???

    Hi all,

    I wonder if anyone could tell me why this code isn't working:

    <a href onClick="document.write('<input type=hidden name=orderBy value=id>'); javascript:document.echoDb.submit(); alert('It works at least');">id</a>

    the document.write() and the document.submit() seem to work if I use only one at a time.

    I'm some kind of lost here...

    Thanks in advance!

  2. #2
    Join Date
    Jun 2003
    the document.write() works in the current code index, this means that it clears the onclick reference to the link, try adding it to a function instead, or failing that use spnas/divs to write it out.

    <a href onClick="spn.innerHTML = '<input type=hidden name=orderBy value=id>'; document.echoDb.submit(); alert('It works at least');">id</a>
    <span id=spn></span>
    If you are using PHP please use the [PHP] and [/PHP] forum tags for highlighting...
    The same applies to HTML and the forums [HTML][/HTML] tags.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center

Recent Articles