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

input type question

Status
Not open for further replies.

cayden2007

Technical User
Mar 19, 2007
22
US
All,
I am trying to add a popup link to input type code likeso:

Code:
<INPUT TYPE=HIDDEN NAME=custom1  VALUE="1 inch x 1 inch purple, blue & rose <a href="javascript:ShowWin_1184393822437()">shipping and handling information</a>">

This does not work.

Does anyone know how I could set this up?

Any help would be appreciated.

Thanks in advance.
 
You can't do that. You cannot put any html into an input element. You can do one of the two.

1. Put the link behind the input element.
2. Put the popup on the actual input:
Code:
<input type="text" name="custom1"  value="1 inch x 1 inch purple, blue & rose - shipping and handling information" onlick="javascript:ShowWin_1184393822437()" />

As I was rewriting your example, I noticed that you were using type="hidden". How do you expect users to find where to click if the input is hidden?

___________________________________________________________
[small]Do something about world cancer today: PACT[/small]
 
Thanks so much for that.

To answer your question, this input type is part of a shopping cart item, so all the input types are hidden. The only thing that is seen is the Add To Cart button itself.
 
Go to this page:
You will see that I have a Add to Cart button. What I want to happen is when the button is clicked, it will take them to the shopping cart page and I want the words "shipping and handling information" to be a link to open this link: javascript:ShowWin_1184393822437()

This link should appear in the Description column on the shopping cart page, but you will notice this is not happening.

I put in what you said and took the "text" off and put "hidden" back in.

Do you have any other suggestions?
 
Here is the entire code for that shopping cart item:

Code:
<FORM METHOD=POST ACTION="[URL unfurl="true"]http://www.safepay.net/cgi-bin/shop/cart.cgi?">[/URL]





<INPUT TYPE=HIDDEN NAME=merchant VALUE="bacastange">
<INPUT TYPE=HIDDEN NAME=name     VALUE="(P-1) Purple, blue & rose">
<INPUT TYPE=HIDDEN NAME=sh		 VALUE="1">
<INPUT TYPE=HIDDEN NAME=price    VALUE="24.00">
<INPUT TYPE=HIDDEN NAME=img      VALUE="[URL unfurl="true"]http://www.bacastange.com/images/pendants/p-1_24small.jpg">[/URL]
<INPUT TYPE=HIDDEN NAME=img2     VALUE="[URL unfurl="true"]http://www.bacastange.com/images/pendants/p-1_24.jpg">[/URL]
<input type=HIDDEN name="custom1"  value="1 inch x 1 inch purple, blue & rose - shipping and handling information" onlick="javascript:ShowWin_1184393822437()" />

<INPUT TYPE=submit NAME="add" VALUE="Add to Cart">
</FORM>

hope that helps
 
Ah-ha, I see now what you've been trying to accomplish. That will unfortunately (or maybe fortunately) not work. If you could put html tags into the hidden field, that would pose a serious security risk to your site.

I think the only way you can do this is to actually change your cgi script to output the shipping information link next to each item. But for that you will need to do server side scripting, which falls out of the scope of this forum.

___________________________________________________________
[small]Do something about world cancer today: PACT[/small]
 
Hi

Honestly, I think your system is too hardly based on [tt]hidden[/tt]s.

Long time ago I was asked to take a look at a system with similar weakness. I remember I posted an order for about 1000 volumes of M.K. by A.H. ( bad book banned in several countries ) at a price around of 0.01 monetary unit ( US $0.0000005 ) each. The cart system just thanked me for and promised to deliver soon. Of course, the ordered book was not even in their database.

I hope that although you use those [tt]hidden[/tt] fields in reality nothing is based on them. Or at least you double check their content before finalizing.

Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top