javascript - disable a textbox in another page PHP

115

is there any way to disable a text input in another page ? I searched but I didn't find any thing !

to explain

I have this page that is mostly html text inputs and I load it in a main page if the user press a button, sometimes I need one of the textbox to be disable and sometimes not

The question is, is there any function in php or javascript or ajax that can help me disable one of the textbox from the main page ?

989

Answer

Solution:

Are you looking for something like this ?

$('.myinput').prop('disabled', true);

There are basically two cases:

  1. In case you do it in PHP you have to submit either post or get data to the script which displays the input
  2. In case you do it which JS or jQuery there must be a condition in your script that tells the input when to be displayed and when not

People are also looking for solutions to the problem: php - combining getElementsByTagName and getElementsByClassName DOMDocument

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.