baseportal
Start

baseportal message board

Welcome to the baseportal message board...

Please read the FAQ.

 
 Selected message: To the list 
    Message from TheOneRing on 2/14 2004, 19:59 +00:00
    EMail: theonering@thegateroom.com WWW: geocities.com/theonering_stargate

    Re: variable usage


      Wow! Thanks! I so don't get Javascript ;)

      I haven't tried it yet but I will and let you know if I still have problems.

      Thanks,
      TheOneRing

    Your reply:

    Name: EMail: WWW:
    Subject:
    Text:
    Timezone:

    Post a new message


 All messages from this thread: To the list 
    Message from TheOneRing on 2/12 2004, 05:05 +00:00
    EMail: theonering@thegateroom.com WWW: geocities.com/theonering_stargate

    variable usage


      I have a form with a textarea written in HTML using a Javascript to count the number of characters entered into the textarea. Don't ask why, it's really necessary ;)

      I need the textarea to pass to the template page for processing so I use the name="Story:=" -- with the := everything works fine.

      The problem now is that with the added Javascript for counting, Javascript doesn't know how to handle the name of "Story:=" -- so to make the JS work, I remove the := but now the variable doesn't transfer to the next template. Any solutions?

      Original working code is here:

      <form name="theForm" action="/baseportal/TheOneRing/Story_archives/Test/Preview_Copy2" method="post" enctype="multipart/form-data" onSubmit="return disableForm(this);">

      <textarea name="Story:="></textarea>
      <input type="submit" value="Preview">
      </form>
      ----------------------

      After Javascript addition, the <textarea> name changes and the variable doesn't pass. The new code is:

      <SCRIPT LANGUAGE="JavaScript">
      <!-- Begin
      function textCounter(field, countfield, maxlimit) {
      if (field.value.length > maxlimit) // if too long...trim it!
      field.value = field.value.substring(0, maxlimit);
      // otherwise, update 'characters left' counter

      else
      countfield.value = maxlimit - field.value.length;
      }
      // End -->

      </script>

      <form name="theForm" action="/baseportal/TheOneRing/Story_archives/Test/Preview_Copy2" method="post" enctype="multipart/form-data" onSubmit="return disableForm(this);">

      <textarea wrap=physical rows="10" cols="100" name="Story" onKeyDown="textCounter(this.form.Story,this.form.remLen,125000);"
      onKeyUp="textCounter(this.form.Story,this.form.remLen,125000);"></textarea>
      <input type="submit" value="Preview">
      </form>

     Post a reply

    Message from Christoph Bergmann on 2/13 2004, 19:49 +01:00
    EMail: info@baseportal.de

    Re: variable usage


      You must use the elements[]-array of javascript to access names with non-alphanumeric characters. In your case:

      this.form.elements["Story:="],this.form.remLen

      ok?
     Post a reply

 Messages from 2700 to 2850: To the input form 
<< Newest messages | < Newer messages | To the input form | Older messages > | Oldest messages >>


Back to the homepage

© baseportal.com. All rights reserved. Terms of use



baseportal.com