PDA

View Full Version : I found this nifty little form select all script but..


amber438
03-04-2005, 05:16 PM
I can't seems to get it to display my recip table in the text area..
anyone have any ideas?

Here's the script (http://www.javascriptkit.com/script/script2/selectall.shtml)

any help would be super!!

Useless Warrior
03-05-2005, 08:40 PM
Could you post how you implemented it on your page? Or just put up a link to the page it's on on your site.

Chop Smith
03-06-2005, 02:37 AM
Amber,
I have used similar code for select all. If you post the URL, I am sure that Useless can be useful and help you. I will also be glad to help.

Could not get it off my mind. Take a look at this. http://choponthelake.com/amber438.html

amber438
03-06-2005, 09:14 AM
Thanks chop and useless..but I dont think it's as easy..what you have in the textarea is just text.
I'm trying to make category specific html recips. So I went looking for a nice little bit of code so I can display my recip and have the submitters copy and paste it.
I can't get the textarea to display it at all so I've not put up anything yet

Here (http://www.redhotgalleries.com/recip.htm) is the recip I'm working eith for now. If I can get it to work, I can use it for both red hot galleries and red hot links for category recips. I think there is some code replacement I am missing?

Cleo
03-06-2005, 09:24 AM
Is this what you wanted your recip to look like?

If you post a link to a page where you actually used that code we might be able to help you getting it to work.

swedguy
03-06-2005, 09:53 AM
http://www.scorpiolinks.com/recips.html

Is that what you want to do?

Cleo
03-06-2005, 10:02 AM
I think Amber wants to add the select all to each textarea.

Personally I think the webmasters all know enough to click inside of the textarea and hit command/control A to select all with needing a script but then I'm amazed at what people don't know.

That script looks easy enough to use with an example and all but I would need to see a page where she actually tried to use it to see what she is doing wrong.

swedguy
03-06-2005, 10:34 AM
Or you can have it copy what's in the textarea automagically to your clipboard, works in both FireFox and IE (not sure about Mac, Cleo?)

http://www.scorpiolinks.com/recips.html

Cleo
03-06-2005, 10:42 AM
Doesn't work in Safari or Mozilla on a Mac, didn't try IE. The page that Amber posted does work on my Mac.

Command A, then Command C works always. On a Mac the Command key does what the Control key does on a PC. The Control key is the right mouse button on a Mac. I use a two button mouse with a scroll wheel so I never use the Control key unless I'm using the track pad that is built-in to my laptop.

Useless Warrior
03-06-2005, 11:25 AM
Ok, I think this is what you want:
http://www.maladaptedmedia.com/amber.html

Leave the Javascript untouched:
<script language="Javascript">
<!--
function selectAll(theField) {
var tempval=eval("document."+theField)
tempval.focus()
tempval.select()
}
//-->
</script>

But....edit these lines for each successive recip:
<form name="recip">
<a href="javascript:selectAll('recip.select1')">Select All</a>
<textarea name="select1" rows=5 cols=20>

The form name must be different for each recip. Make sure the name you give it in 'form name=recip' is the same name you give it in the 'selectAll('recip.select1')' portion of the code.

Then, give each recip a distinct 'select' name. The name given here 'selectAll('recip.select1')' must match the name given in the textarea, such as '<textarea name="select1" rows=5 cols=20>'

The simplest way would be to number them like this:
<form name="recip2">
<a href="javascript:selectAll('recip2.select2')">Select All</a>
<textarea name="select2" rows=5 cols=20>
and
<form name="recip3">
<a href="javascript:selectAll('recip3.select3')">Select All</a>
<textarea name="select3" rows=5 cols=20>

But you should be able to name them per category:
<form name="anal">
<a href="javascript:selectAll('anal.selectanal')">Select All</a>
<textarea name="selectanal" rows=5 cols=20>

Just make sure you give each recip distinct variables.

Cleo
03-06-2005, 11:45 AM
That works for me :)

amber438
03-06-2005, 04:48 PM
I just got home!!
Yeah Swede, that's kinda like what I want to do
I tried it in dreamweaver and the code got all messed up and did not show like you have it there. I added the table for the recip into where the "textarea" goes as is.
I"ll look at the code and see what you did differently!
It works for me!!
Thank you all so much!!