passing javascript to vbscript

Discussion in 'Javascript' started by Katya, May 19, 2005.

  1. Katya

    Katya Guest

    Why the following code doesn't work? What am I doing wrong?

    <input type="hidden" name="test"
    value="javascript:document.form.fld_1.value">

    I want to pass this value to a hidden field in order to get it later
    using Request.Form("test").

    Thank you!
     
    Katya, May 19, 2005
    #1
    1. Advertising

  2. Katya

    kaeli Guest

    In article <>,
    enlightened us with...
    > Why the following code doesn't work? What am I doing wrong?
    >


    Making up code that doesn't exist.

    > <input type="hidden" name="test"
    > value="javascript:document.form.fld_1.value">
    >


    You can't do that.
    And you can't just make up syntax, either. :^)

    > I want to pass this value to a hidden field in order to get it later
    > using Request.Form("test").


    Then modify the onchange of fld_1 to set it.
    You can't do what you're doing. Does not compute.

    Though why you need two fields with the same value when the form has to get
    submitted to the server to do Request.Form anyway, I have no idea.

    --
    --
    ~kaeli~
    With her marriage, she got a new name and a dress.
    http://www.ipwebdesign.net/wildAtHeart
    http://www.ipwebdesign.net/kaelisSpace
     
    kaeli, May 19, 2005
    #2
    1. Advertising

  3. Katya

    Tim Slattery Guest

    "Katya" <> wrote:

    >Why the following code doesn't work? What am I doing wrong?
    >
    ><input type="hidden" name="test"
    >value="javascript:document.form.fld_1.value">
    >
    >I want to pass this value to a hidden field in order to get it later
    >using Request.Form("test").


    You can't use Javascript like that.

    You're trying to copy the value of one form element to another? Attach
    an onUpdate event handler to the first field. The function called by
    that handler should do the copy. That way, every time the first
    element changes, the new value show up in the second element.

    --
    Tim Slattery
     
    Tim Slattery, May 19, 2005
    #3
  4. Katya

    Katya Guest

    This kind of rude reply actually helped me to solve the problem. Thank
    you very much!
     
    Katya, May 19, 2005
    #4
  5. Tim Slattery wrote:

    > You're trying to copy the value of one form element to another?
    > Attach an onUpdate event handler to the first field. [...]


    There is no such thing as an onUpdate event handler, not even in the IE DOM
    (that would be `onupdate', if that). There are standards compliant onkeyup
    and onmouseup handlers, though, and one can call the other to keep behavior
    consistent.


    PointedEars
     
    Thomas 'PointedEars' Lahn, May 25, 2005
    #5
  6. Katya

    Randy Webb Guest

    Thomas 'PointedEars' Lahn wrote:

    > Tim Slattery wrote:
    >
    >
    >>You're trying to copy the value of one form element to another?
    >>Attach an onUpdate event handler to the first field. [...]

    >
    >
    > There is no such thing as an onUpdate event handler, not even in the IE DOM
    > (that would be `onupdate', if that). There are standards compliant onkeyup
    > and onmouseup handlers, though, and one can call the other to keep behavior
    > consistent.


    Any documentation that says it would be onupdate instead of onUpdate? I
    am unaware of any browser that makes intrinsic event handlers case
    sensitive in the markup.

    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
     
    Randy Webb, May 26, 2005
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Spencer
    Replies:
    0
    Views:
    551
    Kevin Spencer
    Jun 27, 2003
  2. keys4worship
    Replies:
    0
    Views:
    878
    keys4worship
    Jun 28, 2005
  3. Jonas Daunoravicius
    Replies:
    5
    Views:
    334
    Peter
    Jul 17, 2003
  4. Jonas Daunoravicius
    Replies:
    5
    Views:
    306
    Peter
    Jul 17, 2003
  5. Replies:
    0
    Views:
    147
Loading...

Share This Page