Populating the SelectBox based on another selectbox selection

Mann06's picture

Hi,

JSON is not a must to populate the selectbox based on another selectbox option.

I have developed a module and sharing with you all the module in text file.
It contains one ajax,one menu link and a function.

It is very simple and good for the drupal learners.

Please use it. contact me for any queries @ manniter006@gmail.com

Best Regards,
Have a happy drupal
Manmohan V Singh
Software engineer
G D Udyog
Varanasi
India

AttachmentSize
updatestock.txt1.5 KB

Comments

Please DON'T use it!

pingwin4eg's picture

@Mann06 your code snippet exposes multiple security holes.

Instead use Form API #states and EntityFieldQuery class.

Securityless

leader_vinay_kumar's picture

Hi, manmohan i appreciated your work but your code lacks security. Please don't use db_query instead use builder query plus use drupal.behaviours while connecting with jquery and there lots of other security holes. I suggest you to go through drupal 7 pro development book there you will learn....and i want you to correct this and post again this module.

Thanks

@leader_vinay_kumar can you

Mann06's picture

@leader_vinay_kumar can you provide me some code snippets whatever security i can maintain in the code. This module 100% tested though someone who want to use it should need to change some lines for avoiding security threats this is just a sample.

Download any module

leader_vinay_kumar's picture

Hi,

Download any module(ctools, selectbox) from drupal.org which is very much similar to this you will get the code that you wanted.

Thanks

Ok sir..

Mann06's picture

Ok sir..