Solved

Forms using VbScript

Posted on 2004-04-06
9
495 Views
Last Modified: 2012-06-27
I am trying to pass a a txt field into the form that is not part of the form is there anyway to do this, ive tried everything. The end result would be the form submitting to a CGI link using Post. The entire project is VbScript no Javascript please.

Thanks in advance.
Greg
0
Comment
Question by:gharman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
9 Comments
 
LVL 2

Expert Comment

by:BobFett
ID: 10764988
Hi Greg,

When you say you are trying to 'pass' a text field in to a form, where are you passing it from?  Is the text field on the same page or another page?

Bob
0
 

Author Comment

by:gharman
ID: 10764994
A Text Field on the same page.
0
 
LVL 31

Expert Comment

by:alorentz
ID: 10765001
No, the point of the form tags is to send a form and it's contents.  If it's outside, it is useless when submitting a form.

What you could do is put a hidden field in the form, that is always the same a the text outside of the form, so that the value will submit with the form.  You will need to use an onchange or onblur event for the text outside of the form the update the hidden field.
0
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 

Author Comment

by:gharman
ID: 10765020
I fully realize the purpose of the from tags my goal in not using the form tags on the area is that the error checking is not good enough unless i can call a txtfield inside a form?

How would i set the value of a hidden field to another textboxt?

<input type="hidden" name="op1" value = (txt.value) >  ?????????

Greg
0
 
LVL 2

Expert Comment

by:BobFett
ID: 10765046
Hi Greg,

I'm afraid all of the things you describe are simple in javascript but as you've said you don't want to use it, I think your stuck.

Bob
0
 
LVL 31

Expert Comment

by:alorentz
ID: 10765071
Here is javascript:

<SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
<!--

function text2_onchange() {
window.form1.text1.value = window.text2.value;
}

//-->
</SCRIPT>
</HEAD>
<BODY>

<P>
<FORM action="" method=POST id=form1 name=form1>

<INPUT id=text1 name=text1>
</FORM>
<br><br>
<INPUT id=text2 name=hidden LANGUAGE=javascript onchange="return text2_onchange()"></P>
0
 
LVL 31

Accepted Solution

by:
alorentz earned 125 total points
ID: 10765081
Here is Client Side VbScript:

<SCRIPT ID=clientEventHandlersVBS LANGUAGE=vbscript>
<!--

Sub text2_onchange
window.form1.text1.value = window.text2.value
End Sub

-->
</SCRIPT>
</HEAD>
<BODY>

<P>
<FORM action="" method=POST id=form1 name=form1>

<INPUT id=text1 name=text1>
</FORM>
<br><br>
<INPUT id=text2 name=hidden></P>
0
 
LVL 31

Expert Comment

by:alorentz
ID: 10765104
Whoops:

Text2 is supposed to be like this: (type=hidden)

Javascript:
<INPUT type=hidden id=text2 name=text2 LANGUAGE=javascript onchange="return text2_onchange()">

VBScript:
<INPUT type=hidden id=text2 name=text2>
0
 

Author Comment

by:gharman
ID: 10765139
Used VB Script works like a charm thanks.

Greg
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question