Jump to content

Manipulate a div onselect


fRAiLtY-

Recommended Posts

Hi guys,

 

Here's my dev page: http://dev4.printpartnerships.com/flyer-printing

 

Thanks to the awesome help I got in the PHP part I've got that table displaying correctly underneath the drop-downs, it's dynamically created. As you can see, I have 4 drop-down boxes. The third one is where you choose the paper, although you can't operate it until you've filled the other 2 out. Once you select an option in there, for example 300gsm stock, I need the table to change.

 

Now, currently I use a function called getFlyers300gsm in my PHP so rather than having a function for every paper stock I was hoping I could have a function called getMatrix() or similar in PHP that passes a variable to the function depending on the value of that dropdown, thus manipulating the table and reloading it.

 

So to summarise, table loads a default set of figures on page load, drop-down box is changed, value is passed to PHP and table is reloaded.

 

I'm not sure whether this is jQuery or Javascript or AJAX so forgive me if this post needs to be moved, I have little experience in JS. The PHP part of the equation I believe I can handle, it's just this part stumps me. If anyone can give me some help I'd greatly appreciate it.

 

Cheers.

Link to comment
Share on other sites

jQuery is a JavaScript framework that was primarily designed to make DOM manipulation easy. It also now comes with components capable of making Ajax easy as well but that is beside the point.

 

Ajax is something completely different. It is a method of asynchronous communication between the client and the server.

 

Both DOM manipulation and Ajax can be achieved through JavaScript alone (after all, jQuery is written in JavaScript) however frameworks such as jQuery, Mootools, Dojo, Backbone (the list really goes on and on and on) just make this stuff a whole lot easier.

Link to comment
Share on other sites

So if I read what you're saying is right, and referring back to my original post, if I want to pass a different value to PHP for data retrieval it's AJAX I'll need, not jQuery?

 

My table is prepoluated with "default" values, however on select of a drop-down will pass a value to a PHP to potentially change the data in that table.

 

Cheers.

Link to comment
Share on other sites

if I want to pass a different value to PHP for data retrieval it's AJAX I'll need, not jQuery?

 

Yes, you'll need Ajax, but as I said, jQuery makes Ajax easier.

 

Ajax is not a thing you can download. It simply a method of communication between the client and the server, it needs to be programmed by you. Again however, jQuery makes this task easier then writing it all yourself.

 

Seriously, if your at all interested in web development you need to learn JavaScript and one of the JavaScript frameworks. jQuery is the most popular choice.

Link to comment
Share on other sites

Ah OK gotcha.

 

One last thing, I'm working on a Magento platform which uses prototype. Is prototype "just another" library like jQuery or mootools, and as such a good option to try and work within this or is it not the case?

 

I've read that libraries can conflict with each other and have used jQuery noConflict in the past to great effect, but am wondering if I have the choice to start with it might be be an idea to try and avoid the conflicts?

 

Cheers

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.