Solved

Forms using VbScript

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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Summernote and form validation 10 232
Executing a script on a timer online 5 32
Hide and Unhide Table 6 27
StoredProcedure to JSON query faulty syntax 2 29
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…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

730 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