Web Analytics Made Easy -
StatCounter Using Javascript to hide PHP form data - CodingForum


No announcement yet.

Using Javascript to hide PHP form data

  • Filter
  • Time
  • Show
Clear All
new posts

  • Using Javascript to hide PHP form data


    I am a Junior programmer, and very new to web development, so please forgive me if what I am asking seems trivial to you. I would greatly appreciate your advice on how to solve this problem or where I can read about it.

    I have a PHP file that contains a HTML form to display a table. The table columns should be displayed selectively, depending on the function parameters. I was wondering whether it is possible to use Javascript to check the condition before the form is loaded and display the columns accordingly?

    Your help is most appreciated. Please let me know if you would like me to provide more details or post a code sample.

    Thank you,

  • #2
    I'm afraid I don't quite understand your question. However, perhaps what I have to add will be of help.
    Php is server side generated. Meaning, once its sent from the server, it is done, and cannot be changed in any way until a new request has been put into the server. Now, unlike languages such as html, javascript and css, which are all client side code, you cannot view the raw php code once its been sent - mearly what is determined to show via HTML or other sources.
    Php is designed to do what you would like it to do. So with this in mind you can send the html to the browser selectively without the need of javascript. You can order it however you see fit prior to th sending.

    Without knowing more of your current situation and status, I'm afraid that I can be of little more help than this. If you would like, you can post an example of what you need, and how its generated in the first place, and we can help you correct it as needed.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)