Top.Mail.Ru
? ?
Javascript's Journal
 
[Most Recent Entries] [Calendar View] [Friends View]

Sunday, November 18th, 2007

Time Event
3:51p
Javasript and Forms...
Fixed! If anyone is interested I can always post it...
I'm trying to make an onClick pass a value to a hidden input field.

(Basically, you click image01, it passes image01 to the input field id="item01"

What I'd like to do is automate this process, so it can be written as:

var itemNum = src.substring(src.lastIndexOf('.'),src.length - 14);
document.getElementById('theForm').itemNum.value=itemNum;

My google-fu is failing me, and my JS isn't the best.

Any ideas?

BTW:

itemNum = the image name, so the image is 'whatever/image01_on.jpg' and returns 'image01_on'

That part works, but automating the process doesn't, so that each image will pass its own value to its own hidden value field.

Thanks as always, x-posted.

<< Previous Day 2007/11/18
[Calendar]
Next Day >>
About LiveJournal.com
Image