Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I need to make a really quick and dirty javascript where the user can choose from one of 3 or 4 options, and when they click on it, it will appear in the following text box:Code: Select all
<textarea name="Product_Attributes[6]:value" rows=10 cols=58 wrap="on"></textarea>Code: Select all
<script language="javascript" type="text/javascript">
var saying = new Array();
saying[0] = "The {your last name} family wishes to announce the new addition to our family! We adopted our beautiful {pet's name} on {date}.";
saying[1] = "We're proud to announce the newest addition to our family... {pet's name}, adopted {date}. -{your name}";
saying[2] = "We've adopted our new pride and joy, {pet's name} on {date}. -{your name}";
document.forms[1].elements['Product_Attributes[6]:value'].value = 'Hi';
function setSaying(num, saying){
if(document.forms){
document.forms[0].elements['Product_Attributes[6]:value'].value = saying[num];
}
}
function getSaying(num, saying){
return saying[num];
}
</script>
<!-- This is for listing the sayings on the page /-->
<script language="javascript" type="text/javascript">
if(document.forms){
document.write('<ul style="list-style-type: none; font-size: 11px; font-family: verdana, arial, sans-serif;">');
for(i = 0; i < saying.length; i++){
document.write(' <li style="padding-top: 5px"><a href="merchant.mvc?Screen=PROD&Store_Code=MTP&Product_Code=ANNF#top" onclick="javascript:setSaying(' + i + ', saying);">' + (i+1) + '. </a>' + saying[i] + '</li>');
}
document.write('</ul>');
}
</script>I really really need to work on my javascript skills...
JayBird | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]