Jump to content

[SOLVED] Is there?


SkyRanger

Recommended Posts

um... that would be a very EASY onclick ajax function. Lol

 

Wait, no server needed stuff here, this is what you could do.

 

 

<script type='text/javascript'>

<!--

function echo_text(radio_id){

 

var input = document.getElementById('radio' + radio_id).value;

document.getElementById('textarea_id').value = input;

}

//-->

</script>

 

 

<input type='radio' onclick='echo_text("1")' value='my_first_radio' name='whatever' id='radio1' />

<input type='radio' onclick='echo_text("2")' value='my_second_radio' name='whatever' id='radio2' />

 

<textarea id='textarea_id'></textarea>

Link to comment
https://forums.phpfreaks.com/topic/48723-solved-is-there/#findComment-238771
Share on other sites

also replied in your thread to >_>

 

Also, to the owner of this topic, theres a more automatic way to tell based on if the radio was checked instead of manually defining the id number extension in the onclick function, however im no god at javascript. So there is a bit more of an easier way to write this, but meh, next guy can handle that if writing "1" "2" "3" etc inside the function is to much for you :D

Link to comment
https://forums.phpfreaks.com/topic/48723-solved-is-there/#findComment-238781
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.