Jump to content


Photo

Advanced Select form

php form html advanced live

  • Please log in to reply
10 replies to this topic

#1 patchido

patchido

    Advanced Member

  • Members
  • PipPipPip
  • 59 posts

Posted 22 February 2013 - 04:33 PM

im not sure if i should post it in php or html. but here it goes.


im trying to do an application with dropdown selection options where one selector depends on the last, two levels this way.

the options are in a mysql datbase so by using php im retrieving the array for each selector, but how can i make the selectors change live depending on which option you choose without refreshing the page?


do i need something else? like javascript or something like that? i know nothing about JS


Thanks for taking your time reading this,

Edited by patchido, 22 February 2013 - 04:34 PM.


#2 Jessica

Jessica

    This is not my name.

  • Gurus
  • 8,982 posts
  • LocationDallas, TX
  • Age:26

Posted 22 February 2013 - 04:37 PM

Ajax!
Google Chained Selects + Ajax.
My goal in replying to posts is to help you become a better programmer, including learning how to debug your own code and research problems. For that reason, rather than posting the solution, I reply with tips and hints on how to find the solution yourself. See below for useful links when you get stuck.

How to Get Good Help: How to Ask Questions | Don't be a help vampire
Debugging Your Code: Debugging your SQL | What does a php function do? | What does a term mean? | Don't see any errors?
Things You Should Do: Normalize Your Data | use print_r() or var_dump()
Lulz: "Functions should not have side effects." - trq

Please take a look at my new PHP/Web Dev blog: The Web Mason - Thanks!!

#3 patchido

patchido

    Advanced Member

  • Members
  • PipPipPip
  • 59 posts

Posted 22 February 2013 - 05:02 PM

damn, i don't even know what ajax is, is it a complement of JS?

#4 patchido

patchido

    Advanced Member

  • Members
  • PipPipPip
  • 59 posts

Posted 22 February 2013 - 05:05 PM

is it difficult?? maybe i could get a template and just populate it with my information? its 3 chained selects what i need

#5 denno020

denno020

    Advanced Member

  • Members
  • PipPipPip
  • 712 posts
  • LocationAustralia

Posted 22 February 2013 - 06:21 PM

Ajax is quite simple. It stands for Asychronus Javascript and XML.

If you want to go the exceptionally easy route, you can use jQuery. Otherwise you could look up tutorials on YouTube on how to do pure javascript AJAX (which isn't harder than jQuery, it's just got longer variable names, so it looks harder).

#6 patchido

patchido

    Advanced Member

  • Members
  • PipPipPip
  • 59 posts

Posted 22 February 2013 - 06:28 PM

maybe this helps finding the best way for me to make it,


what if i want to add more lines of selectables, something like this, when u open the first page you will see this.

/////////////////// /////////////////// //////////////////
choose type - choose food - choose size
////////////////// /////////////////// //////////////////



and there is a dropdown menu to add more lines. so if i add 2 lines ill have.

/////////////////// /////////////////// //////////////////
choose type - choose food - choose size
////////////////// /////////////////// //////////////////

/////////////////// /////////////////// //////////////////
choose type - choose food - choose size
////////////////// /////////////////// //////////////////

/////////////////// /////////////////// //////////////////
choose type - choose food - choose size
////////////////// /////////////////// //////////////////

thanks!

#7 Jessica

Jessica

    This is not my name.

  • Gurus
  • 8,982 posts
  • LocationDallas, TX
  • Age:26

Posted 22 February 2013 - 07:11 PM

That is also something you would do with Javascript. 

Look into using jQuery.
My goal in replying to posts is to help you become a better programmer, including learning how to debug your own code and research problems. For that reason, rather than posting the solution, I reply with tips and hints on how to find the solution yourself. See below for useful links when you get stuck.

How to Get Good Help: How to Ask Questions | Don't be a help vampire
Debugging Your Code: Debugging your SQL | What does a php function do? | What does a term mean? | Don't see any errors?
Things You Should Do: Normalize Your Data | use print_r() or var_dump()
Lulz: "Functions should not have side effects." - trq

Please take a look at my new PHP/Web Dev blog: The Web Mason - Thanks!!

#8 patchido

patchido

    Advanced Member

  • Members
  • PipPipPip
  • 59 posts

Posted 26 February 2013 - 12:02 PM

AJAX vs Jquery? which one is easier for someone who hasn't code any JS?



#9 Jessica

Jessica

    This is not my name.

  • Gurus
  • 8,982 posts
  • LocationDallas, TX
  • Age:26

Posted 26 February 2013 - 12:04 PM

jQuery is a javascript library. It makes it easy to do AJAX.
My goal in replying to posts is to help you become a better programmer, including learning how to debug your own code and research problems. For that reason, rather than posting the solution, I reply with tips and hints on how to find the solution yourself. See below for useful links when you get stuck.

How to Get Good Help: How to Ask Questions | Don't be a help vampire
Debugging Your Code: Debugging your SQL | What does a php function do? | What does a term mean? | Don't see any errors?
Things You Should Do: Normalize Your Data | use print_r() or var_dump()
Lulz: "Functions should not have side effects." - trq

Please take a look at my new PHP/Web Dev blog: The Web Mason - Thanks!!

#10 patchido

patchido

    Advanced Member

  • Members
  • PipPipPip
  • 59 posts

Posted 26 February 2013 - 12:05 PM

ohh i see, ill look for some tuts on jquery then, any advice on any specific tuts?

 

thanks



#11 Love2c0de

Love2c0de

    Advanced Member

  • Members
  • PipPipPip
  • 366 posts
  • LocationThe Pleiades
  • Age:23

Posted 26 February 2013 - 05:07 PM

I found this series very useful: http://blog.themefor...s-video-series/

 

Regards,

 

L2c.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com