Solved

Forms using VbScript

Posted on 2004-04-06
9
481 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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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/…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

840 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