without using JavaScript events

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sbettadpur
    New Member
    • Aug 2007
    • 121

    without using JavaScript events

    Hi,

    how can we do in php without using JavaScirpt events such as OnChange, OnSelect is there any way to approach using only pure php
  • ak1dnar
    Recognized Expert Top Contributor
    • Jan 2007
    • 1584

    #2
    Originally posted by sbettadpur
    Hi,

    how can we do in php without using JavaScirpt events such as OnChange, OnSelect is there any way to approach using only pure php
    Could you please elaborate your question with some sample code snippets or any other form, I couldn't get a clear picture yet.

    Comment

    • pbmods
      Recognized Expert Expert
      • Apr 2007
      • 5821

      #3
      Heya, sbettadpur.

      PHP doesn't work that way.

      PHP operates purely on the server. What it literally does is generate the HTML that then gets sent to the browser. If you would like the User to be able to interact with your page after that point, you have to use JavaScript.

      Many developers are under the misconception that PHP can call JavaScript functions or vice versa; it can't. You can have the PHP generate JavaScript that the browser then evaluates when it loads the page, but that's not the same thing.

      Comment

      • sbettadpur
        New Member
        • Aug 2007
        • 121

        #4
        Originally posted by ajaxrand
        Could you please elaborate your question with some sample code snippets or any other form, I couldn't get a clear picture yet.
        I have two list boxes one is loading from the database and autopopulated and another list box should be loaded when i select any one option from the first list box.

        for example listbox1 contains list of country names.
        if i click any of country on first list box the respective states will be populated into the second list box.
        i think by this example u can able to catch my point.

        I got above result using javascript event onchange(), but i don't want to use javascript. it should be in pure PHP, is there any way to do above things i.e any class something like that i u know pls send explanation.

        Comment

        • ak1dnar
          Recognized Expert Top Contributor
          • Jan 2007
          • 1584

          #5
          First go for a search please.
          there are lots of example for "Php Dependant drop down boxes". Just google for it.

          Comment

          • etiainen
            New Member
            • Aug 2007
            • 40

            #6
            You might wanna try PHPLiveX library, but that wont free you from javascript, it's only a way to publish your php functions to javascript in a page and call them from there using XHR requests (ajax).

            Comment

            • pbmods
              Recognized Expert Expert
              • Apr 2007
              • 5821

              #7
              Heya, sbettadpur.

              To do this, you'll need to submit a form, but without using JavaScript, the User will have to click on a button to manually submit the form.

              To make the page automatically submit the form when the User makes a selection requires JavaScript.

              Comment

              Working...