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!

Script Needed or an Example

Status
Not open for further replies.

Montroze

Technical User
Apr 20, 2001
113
0
0
CA
Hi, what I want to do is have a page with emoticons and beside each one a radio button, that when clicked will add in a box the path to the emoticon...something like this,

Icon1 (Radio button checked off)Box ->" icon"

That can be copied and pasted from the result box.

A short example would be awesome...
 
"...will add in a box the path to the emoticon..."

do you mean that the page the emoticon links to will be set only if the radio button is clicked?

or,

if the radio button is clicked the path is added into an array of links?

and,

where does the link point to before any action takes place?

what is the end result? (or 'desired')


- spewn
 
Here's what Im trying to do,

Pick an Icon</center> <br>
<img src=&quot;htp:// type=&quot;radio&quot;
name=&quot;icon&quot; onclick=&quot;check(this.value)&quot;
value=&quot;htp://<center><input type=&quot;text&quot;size=&quot;55&quot; name=&quot;answer&quot;>
</form>

I would like the box to include the <img SRC=&quot;http:// etc.
But it will only post in the Box htp://icon location and I can't get the <img SRC= to be posted after the value=

Typo's http on purpose for this posting
 

is the desired effect to change the icon depending on the selection they choose? like if the click radio button 'phone' the icon will become phone, or if radio button 'mail' an envelope will appear in the same place as the phone was?

- spewn
 
Nope the icons are on the page, right beside them is the radio button,
headphone.gif
pic1 'click the radio button' -> fills in the box with the URL which I am trying to get it setup so it can just be copied and pasted in forums. Of course their will be many pic's but whichever is picked the link goes into the box.
 
I'm still experimenting with this stuff, but I guess I'll take a shot at it...

Try setting up the image address as a hidden element...

<input type=&quot;hidden&quot; name=&quot;smilie01&quot; value=&quot;
onClick=&quot;document.form.textbox.value=document.form.smilie01.value&quot;

Or you could set the image address to a variable...

<script>
var smilie01=</script>

onClick=&quot;javascript:this.value=smilie01&quot; :)
 
try this...(ie 5+ tested)

**

<script>

function textin(n) {

eval(&quot;document.all.imgbox&quot;+n+&quot;.value=document.all.img&quot;+n+&quot;.src&quot;);

}

</script>

<br><br>
<img src=' name=img1><input type=radio name=imgs onclick=textin('1');> 
<input type=text size=30 name=imgbox1 value=''>
<br><br><img src=' name=img2><input type=radio name=imgs onclick=textin('2');> 
<input type=text size=30 name=imgbox2 value=''>
<br><br><img src=' name=img3><input type=radio name=imgs onclick=textin('3');> 
<input type=text size=30 name=imgbox3 value=''>
<br><br>

**

what do you think?


- spewn
 
Spewn, this script does pretty much like mine does, it does not post the <img SRC= into the box...just the &quot;http://
would like the box to have the full path(and Ill be adding a highlight all button right above the file path...wanting this outcome in the box
<img SRC=&quot;So it can be copied and pasted with out having to manually add it the <img etc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top