Javascript help needed.
PostPosted: Wed Dec 17, 2003 12:42 am
I'm designing the custom avatar system for Kaldris, and at the moment I'm writing the character creation screen.
OK, here's what I need to do.
I have a <form> which consists of several radio buttons, which are used to select various attributes such as hair style, hair colour, eye colour, race, gender, etc.
Somewhere on the same page there will be an image of the user's character. I want it so that when you click a certain button on the form, it reloads this image. Here's the catch:
The image is generated by a php file. The URL will be something like "kavatar.php?hair_colour=1&race=2&eye_colour=4 ..." etc (but the URL will probably look longer than that)
The selections that the user has made on the form need to be stored into numeric variables and then used as part of the URL for the image when the "refresh avatar" button is clicked. This way, the PHP file recieves the attributes from the form, allowing it to generate the correct customised avatar for the user.
I hope I've outlined the guts of this system clearly enough. I don't know any Javascript though, so any help would really be appreciated! Thanks
HINT: Check this out to get a feel for what I mean (IMO their system doesn't work too well though - it's functionless in Mozilla anyway):
http://ruby.go-gaia.com/forum/character.php
OK, here's what I need to do.
I have a <form> which consists of several radio buttons, which are used to select various attributes such as hair style, hair colour, eye colour, race, gender, etc.
Somewhere on the same page there will be an image of the user's character. I want it so that when you click a certain button on the form, it reloads this image. Here's the catch:
The image is generated by a php file. The URL will be something like "kavatar.php?hair_colour=1&race=2&eye_colour=4 ..." etc (but the URL will probably look longer than that)
The selections that the user has made on the form need to be stored into numeric variables and then used as part of the URL for the image when the "refresh avatar" button is clicked. This way, the PHP file recieves the attributes from the form, allowing it to generate the correct customised avatar for the user.
I hope I've outlined the guts of this system clearly enough. I don't know any Javascript though, so any help would really be appreciated! Thanks
HINT: Check this out to get a feel for what I mean (IMO their system doesn't work too well though - it's functionless in Mozilla anyway):
http://ruby.go-gaia.com/forum/character.php