More JavaScript help...

Is there a form field called “skill01” anywhere? All I see is one called “point01”.

Oh, er no. I didn’t want it to fill in a field, just have whichever item is selected be stored for future use, and when the info is submitted, put into a certain place on the results page (choose Acting, it will put Acting - (insert point value given in the field next to it) - % calc’ed from the point value given).

EDIT: Also, same thing for the weapon skills and race/class/job chosen.

You don’t have to store it. Make another function when the form is submitted (using a button rather than SUBMIT) and in that function you’d create a new window with the results (it’s simpler than using GET to send to a totally new page). But that’s complicated. -_- I don’t have time to demonstrate right now, sorry.

Oh, so the whole function changeRace { if myRace == “blah” document.form.etc and the other ones aren’t needed?

The changeClass() function changes the available classes based on your race. The changeJob() function changes the available jobs based on your class. The others, apparently, aren’t needed.

Er, Class isn’t based on Race at all… Huh. So I’m currently looking at this for code:

http://cala.nulani.net/genfix.html

I left the onChange part in, didn’t know if they were needed.

Can you please be a little more specific about exactly what you want to happen and what you want it to look like? I’m trying to guess here. -_-

Whoops, sorry. Alright, for each part:

Race: They choose one, and depending on which race they select, it’ll set 6 different values (STR, VIT, AGI, SPD, MAG, SPR), all numbers.

Class: Mostly just to determine Job, but will also play an impact on calculating stuff with Disadvantages and such (not yet in there), such as modifying a point value it would have.

Job: What they are (Dragoon, Black Mage, etc.). Also sets 6 values (additional to the previous STR, VIT, AGI, SPD, MAG, SPR, and the two will actually be added together). Also will affect skills calculation and Job-related abilities (Jobs have unique abilities, and all Jobs get certain skills at half the normal cost).

(Weapon) Skills: Mostly to just grab the name later, as the number they input will be the one used for mathematics, although if they choose one they have an affinity for (certain Jobs halve costs), that’ll affect it. Weapon skills will be used to determine Attack%, which is related to level and weapon skill.

Equipment (Right/Left Hand, Head, Body, Arms, Accessory): Their gear, which will serve as both a placeholder for a name and giving values to calculate (1d8 + 3xAGI, etc.).

OK, let me re-ask that question. I’m not so much interested in what each of the boxes means. I’m more interested in what happens when you change a box. Which other boxes/fields will be affected and how? The final calculations, as I said, can be done upon form submittal and don’t have to be “stored” anywhere.

Oh.

The Class will affect what Job you have, and there will be a similar set-up for equipment (weapons would first be Axe -> Battleaxe, Fire Axe, etc., or you could choose Bow and get Crossbow, Long Bow, etc. Headgear will follow a similar pattern with Hats and Helmets, Body will be Mail/Suits/Robes, Arms will be Gauntlets/Armwear, and Accessories would be Status/Magic/Boosters).

So basically it would look like this:

Class Choice
(Job Choice affect by Class Choice)

Right Hand
(Weapon or Shield Choice)
(Weapon Type listed if Weapon chosen, else Shields listed)
(Specific type of Weapon listed (Axe, Bow, etc.))

Left Hand
(Same as Right)

Head
(Helmet or Hat)
(List Helmet or Hat, depending on choice)

Arms
(Gauntlet or Armwear)
(List Gauntlet or Armwear, depending on choice)

Body
(Suit, Mail, Robe)
(List Suit, Mail or Robe, depending on choice)

Accessory
(Attribute, Status, Magical)
(List appropriate accessory depending on which was chosen)

Sorry for the confusion.

So basically, you’re going to want a function for each select box that would change something else when you change it. E.g. when you select your class, your job changes - that means that the class selection needs a function that sets the job box. Here’s a quick reminder of how to do what you want (everything in parentheses means stick in whatever should go in the parentheses, with the exception of the () after a function name, which should be there):

Storing a value in a variable:
var variableName = (expression);
Expression for getting value from combo box:
document.(formName).(comboName).options[document.(formName).(comboName).selectedIndex].value
Expression for getting value from text box:
document.(formName).(textName).value

Setting a text box:
document.(formName).(textName).value = variableName;

Setting a combo box:
document.(formName).(comboName).options[0] = new Option(newValue, newValue);
document.(formName).(comboName).options[1] = new Option(newValue2, newValue2);
etc.

Declaring a function (in the SCRIPT tags):
function (functionName())
{ (get and set whatever you want)
}

Activating the function after a user fills in a combo box:
<SELECT NAME="(comboName)" onChange="(functionName)()">
Activating the function after a user fills in a text box:
< INPUT NAME="(textName)" onChange-"(functionName)()">

Please let me know if there’s something up there that you don’t understand. :sunglasses:

Alright, been working on that, but not done yet. Question, though. Is it possible to do multiple “onLoad” statements like I did before since I have multiple menus? I have the code here: http://cala.nulani.net/ffrpg/generator.html

You mean onChange commands? Yes, you can have one for every form field that changes (combo boxes, text boxes, etc.).

Nono, like when you refresh the page, it’ll automatically select the first option for all the menus?

Since the page only loads once (and it can’t load in different circumstances), whatever is in your onLoad function is what’ll happen. E.g.
<SCRIPT> …
function myLoader()
{ doSomething…
}
…</SCRIPT>
<BODY onLoad=“myLoader()”>

and all the doSomethings will execute when the page loads.

In this case, select the first option. You gave me the code last time I was doing a page. I don’t recall a function, just this:

<BODY onLoad=“document.form1.comboRace.selectedIndex = 0;”>

That’s if you only want one statement to execute. But you can have an entire function execute if you put the function call in the quotes like I showed above.