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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Textbox Value 1

Status
Not open for further replies.

snt

MIS
Jun 19, 2000
104
US
I need to pass info from one textbox to another. This is not a problem. The problem arises when then name of the textbox for the info to be passed to is
option|001|%%prodID-*%%. This is needed to pass the variable to the options in a shoppong cart.
Ok, my question is, how can i pass a value into this textbox? The standard document.form.box.value=.... doesn't work. Is there a way to strip the %% and the || to get the value to pass, and then put them back so the info can pass to the cart?

Thanks
 
I don't get it.

You're saying the textbox's name is
Code:
option|001|%%prodID-*%%
??
bluebrain.gif
blueuniment.gif
 
Yes, but you are going to have to think in terms of runtime. Since that name field changes with, presumably, each instance, you are going to have to create a conditional that will pull it at runtime before you can manipulate it.

It's difficult to be more specific without a solid example to work with, but I hope it helps a little. "It's easier to ask forgiveness than it is to get permission." - Rear Admiral Dr. Grace Hopper
 
Well, if you must... This is how you access your TEXTAREA named
Code:
option|001|%%prodID-*%%
:
Code:
document.forms.myForm["option|001|%%prodID-*%%"];
bluebrain.gif
blueuniment.gif
 
bra1niac,

I am not that familiar with perl to be able to do something like that.

uniment,
i tried
<script language=javascript>
function setOther(){
window.opener.myForm.[&quot;option|013|%%prodID-*%%&quot;].value = document.thisForm.thisBox.value;
}
</script>

<INPUT type=&quot;submit&quot; value=&quot; Send &quot; onclick=&quot;setOther()&quot;>

but it doesn't work.
Any other suggestions
 
In your newly-opened window:

Code:
<script type=&quot;text/javascript&quot;>
function setOther() {
[tt]
Code:
 opener.document.forms.myForm[&quot;option|013|%%prodID-*%%&quot;].value = document.forms.thisForm.thisBox.value;
[/tt]
Code:
}
</script>
<form name=&quot;thisForm&quot;>
 <textarea name=&quot;thisBox&quot;></textarea>
 <input type=&quot;submit&quot; onclick=&quot;setOther()&quot;>
</form>

and in your opener:
Code:
<form name=&quot;myForm&quot;>
 <textarea name=&quot;option|013|%%prodID-*%%&quot;></textarea>
</form>




In the code above, note that the this:
Code:
opener.document.forms.myForm[&quot;option|013|%%prodID-*%%&quot;].value

Does NOT have a period preceding

Code:
[&quot;option|013|%%prodID-*%%&quot;]
bluebrain.gif
blueuniment.gif
 
Thank you. That's what I needed.

SNT
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top