Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

generic function to assign 1 text box to another 1

Status
Not open for further replies.

Deadline

Programmer
Feb 28, 2001
367
US
Hi, How are you today ?

I have 4 text boxes. I need to write a generic function that'll accept name of two textboxes and assign the first textbox's value to the second one. How to do it ?

E.g assign(txtBox1, txtBox2)

VBSCript is ok.


Thanks in advance.

RR
 
its simple.......

<script language=vbscript>
sub button1_onclick()
call assign(text1,text3)
end sub

sub button2_onclick()
call assign(text2,text3)
end sub


function assign(txt1,txt2)
txt1.value = txt2.value
txt2.value = &quot;new three value&quot;

end function
</script>


<P>&nbsp;</P>
<INPUT type=&quot;text&quot; id=text1 name=text1 value=one>
<INPUT type=&quot;text&quot; id=text2 name=text2 value=two>
<INPUT type=&quot;text&quot; id=text3 name=text3 value=three>
<INPUT type=&quot;button&quot; id=button1 name=button1 Value=&quot;3 - > 1&quot;>
<INPUT type=&quot;button&quot; id=button2 name=button2 value=&quot;3 -> 2&quot;>

guess, this is what you are looking for.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top