passing javascript to vbscript

K

Katya

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!
 
K

kaeli

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.

--
 
T

Tim Slattery

Katya said:
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.
 
K

Katya

This kind of rude reply actually helped me to solve the problem. Thank
you very much!
 
T

Thomas 'PointedEars' Lahn

Tim said:
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
 
R

Randy Webb

Thomas said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top