Jump to content


Photo

auto loading forms?


  • Please log in to reply
3 replies to this topic

#1 php_b34st

php_b34st
  • Members
  • PipPipPip
  • Advanced Member
  • 168 posts

Posted 21 October 2006 - 11:49 PM

Im not sure if this can be done with php I think its done with javascript but there is no harm in asking right? I have seen sites with forms as soon as u do a certain thing on the form it loads more options without submitting ie if i change a radio button it would load a new set of options on the page. Anyone know if this can be done with php?

#2 hitman6003

hitman6003
  • Members
  • PipPipPip
  • Advanced Member
  • 1,807 posts

Posted 22 October 2006 - 12:18 AM

Not with php, at least the client side portion is not php.  I would have to be javascript.

You can either load all of the values into javascript variables then manipulate the display based on selections, or you can use AJAX and some server side processing to generate html to replace portions of the page with.

#3 mainewoods

mainewoods
  • Members
  • PipPipPip
  • Advanced Member
  • 685 posts
  • LocationMaine

Posted 22 October 2006 - 12:26 AM

that can't be done with php, that is always done with javascript.  php only activates when you load a page(calls the server).  what you want is to use the onClick() event with your radio button and attach that to some javascript code that alters the dom. innerHTML is one easy dom element to use that has wide browser compatability.  To lookup the actual syntax to use you'll need the wc3 javascript reference manual:

http://www.w3schools.../js/default.asp


#4 php_b34st

php_b34st
  • Members
  • PipPipPip
  • Advanced Member
  • 168 posts

Posted 22 October 2006 - 12:27 AM

Yes I thought as much but I think that is beyond my capabilites for now. Thank you for verifying this for me.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users