Creating a dynamic table with Javascript

They have: 2 posts

Joined: Aug 2011

So I read this article called "Creating a table with dynamically highlighted columns like Crazy Egg’s pricing table" at http://askthecssguy.com/articles/creating-a-table-with-dynamically-highl... and it helped me make a form that I people can click on to see one column of a table and have a forum cover up the un-selected columns. It works great but I want to add unique content to each form depending which column you click.

For example if you click column A the form will ask you your email and password and if you click column B it will ask you for your name, email and password.

Can anyone help me with this?

He has: 698 posts

Joined: Jul 2005

I'm a little confused about exactly what you want. If you can give a link to what you have now, or a screenshot or something we can look at, that would help.

With that said, it sounds like what you could do is create several forms and show a specific one based on the choice made. Or, give each input field a unique ID or class and bring them using JavaScript when a certain choice is made.

Kurtis

They have: 2 posts

Joined: Aug 2011

I have put it all together at http://test.hirealocaldesigner.com/?page_id=59 but don't look at the colors I haven't styled it at all.

What I would like it to give information about each plan as you click it so if you click the $10 one it tells you about the plan and you can sign up right there. If you click the $100 one it would give you different information and maybe ask you to fill out different information in the form.

I think you are right with creating several forms and show a specific one depending on the column clicked but I am new to JavaScript and am not sure how to make that happen.

He has: 698 posts

Joined: Jul 2005

Just give each form a unique ID, and using CSS set their default display to 'none'. Then, when a certain selection is made, set their display so that they are shown. Other than that you just need to build the appropriate forms to handle your different price points.

Kurtis

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.