Solved

Forms using VbScript

Posted on 2004-04-06
9
455 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
  • 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
 

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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now