1

Topic: Xhtml strict, form tags and javascript.

With regards to xhmtl1.0 strict, the 'name=' attribute isn't allowed in the '<form' tag, so is there any way to make the combination below work without it?

    438         <script type="text/javascript">
    439         function AddSmiley(text) {
    440                 var txtarea = document.post.req_message;
    441                 text = ' ' + text + ' ';
    442                 if (txtarea.createTextRange && txtarea.caretPos) {
    443                         var caretPos = txtarea.caretPos;
    444                         caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;
    445                         txtarea.focus();
    446                 } else {
    447                         txtarea.value  += text;
    448                         txtarea.focus();
    449                 }
    450         }
    451         </script>
    452
    453
    454 <div class="blockform">
    455         <h2><span><?php echo $lang_topic['Quick post'] ?></span></h2>
    456         <div class="box">
    457         <form id="post" name="post" method="post" action="post.php?tid=<?php echo $id ?>" onsubmit="this.submit.disabled=true;if(process_form(this)){return true;}else{this.submit.disabled=false;return false;}">

Cheers,

Matt

Re: Xhtml strict, form tags and javascript.

Hrmm, I need to rewrite that mod someday big_smile

document.getElementById('post').req_message

3 (edited by MattF 2007-06-09 16:56)

Re: Xhtml strict, form tags and javascript.

big_smile big_smile

Cheers. Worked a treat. smile

Needed to change it slightly for post.php to:

var txtarea = document.getElementById('post').msg;

and edit.php needs:

var txtarea = document.getElementById('edit').req_message;

Now got strict working on pretty much everything. big_smile big_smile (It becomes a bit of an obsession once you start cleaning up html). big_smile big_smile


Thanks again,

Matt

Edit: Btw, that one you posted above is the one for viewtopic.php, for the quick reply box. big_smile