473,320 Members | 1,853 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

passing javascript to vbscript

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!

Jul 23 '05 #1
5 1454
In article <11*********************@z14g2000cwz.googlegroups. com>,
lo******@gmail.com 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

Jul 23 '05 #2
This kind of rude reply actually helped me to solve the problem. Thank
you very much!

Jul 23 '05 #3
"Katya" <lo******@gmail.com> 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
Sl********@bls.gov
Jul 23 '05 #4
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
Jul 23 '05 #5
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
Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Jonas Daunoravicius | last post by:
The subject pretty much sums up what I need to do. Here is what I have so far, but still can't figure out how to get it working: <script language="javascript" type="text/javascript"> function...
6
by: John Davis | last post by:
Just wonder if <%@ Language="JAVASCRIPT" %> exists?? Since JavaScript is used in client-side scripting, but <% ... %> is used in server-side scripting. It sounds doesn't make sense. But I saw...
5
by: John Davis | last post by:
When I create new documents in Dreamweaver, there are several choices for ASP creation: ASP JavaScript: run at client side?? ASP VBScript: run at server side?? ASP.NET C# ASP.NET VB I don't...
1
by: Patrice | last post by:
Hi, I'm trying to use a javascript function passing a vb variable. I don't understand why it doesn't work. Can someone help me? Thanks in advance. Here is my javascript function used to...
7
by: Dave A | last post by:
I have two events in a form that I am passing. One is to a javascript function, the other is to the same .asp page only with another action to show different data. Onchange is calls the...
3
by: Abby Lee | last post by:
My code works but because I'm using VBscript within JavaScript I get an error message...the yellow tri-angle with an "!" mark. ---------------within my body------------- <script...
13
by: Alex Molochnikov | last post by:
Is there any way to find out programmatically if Javascript is supported/enabled in a browser? By "programmatically" I mean on the Java servlet side. TIA Alex Molochnikov Gestalt Corporation
11
by: Doug van Vianen | last post by:
Hi, I often like to include some JavaScript coding in my web pages to make them more interesting. Unfortunately, even when this coding is as simple as a check to see what the display width is in...
10
by: Shadow Lynx | last post by:
That subject packs a whallop, so let me explain in better detail what's happening and how it relates to ASPX pages... In a nutshell, if the first <script /on a page is of type "text/vbscript",...
9
by: Erwin Moller | last post by:
Hi, Can anybody comment on this? In comp.lang.php I advised somebody to skip using: <script language="javascript"> and use: <script type="text/javascript"> And mr. Dunlop gave this response:
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.