Jump to content

Need a push start


SharkBait

Recommended Posts

Ok

  I have a small form with two radio buttons and a textarea.

The two radio buttons have images associated to them.

When a user selects a radio button, then the textarea is updated with the approrate string.

I'm not sure what to look for.  OnClick? and then somehow update the document.ElementId with text I need in the textarea?

The idea is:
User selects a logo, the HTML code for the selected image is created and presented to the user via the textarea.

:)
Link to comment
https://forums.phpfreaks.com/topic/30681-need-a-push-start/
Share on other sites

[code]
<input type="radio" name="imgPicker" value="1" onClick="setImg(this);" />

function setImg(rbtn) {
var targBox = document.getElementById('myTextField');
if(rbtn.value == 1) {
  targBox.value = '<img src="img1.png">';
} else {
  targBox.value = '<img src="img2.png">';
}
}
}[/code]
Link to comment
https://forums.phpfreaks.com/topic/30681-need-a-push-start/#findComment-141369
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.