Home > front end >  Js to input assignment problem
Js to input assignment problem

Time:10-28

Such as the web site http://mobile.yangkeduo.com/login.html
Give a phone number that input to perform js assignment document. The getElementById (' user - mobile). Value='https://bbs.csdn.net/topics/15888888888';
And then manually trigger events the blur, change and so on, all have no effect
Send button is always gray, and by looking at the table elements, does not modify the value of real value, consult everybody what reason, how to implement?

CodePudding user response:

Family form is onchange event, it is in your input to change state at the same time, direct assignment must be useless and onchange listener input box to see if there is value, there is value the disable button are removed, no value is automatically and disable is grey

CodePudding user response:

reference 1st floor front _ rookie response:
somebody else's form is the onchange event, is in your input to change state at the same time, direct assignment must be useless and onchange listener input box to see if there is value, have value have the disable button are removed, have no value is automatically and disable grey


I have to use js triggered the blur, change of events, or invalid,

CodePudding user response:

Spell so cow force of technology, CSDN no who can understand?

CodePudding user response:

Is how to write your own, through the blur and change event to change the verification code inside of disabled attributes can
Var a=document. GetElementById (' code - the button).
A. d. isabled=false;
Natural color display
Their try to know more, or stick your code, how do you do, do not come out to others can help you, you said you have triggered the doesn't mean you are right, put the code out to see what's the problem

CodePudding user response:

reference 4 floor front _ rookie response:
is how to write your own, through the blur and change event to change the verification code inside of disabled attributes can
Var a=document. GetElementById (' code - the button).
A. d. isabled=false;
Natural color display
Their try to know more, or stick your code, how do you do, do not come out to others can help you, you said you have triggered the doesn't mean you are right, let out the code and see what's the problem with


Thanks for your reply, you this method tried, I can't, all the following code
Document. The getElementById (' user - mobile). Value='https://bbs.csdn.net/topics/15888888888';
Var evt=document. CreateEvent (' HTMLEvents'); Evt. InitEvent (' blur ', true, true); Document. The getElementById (' user - mobile). DispatchEvent (evt).
Var evt=document. CreateEvent (' HTMLEvents'); Evt. InitEvent (' change ', true, true); Document. The getElementById (' user - mobile). DispatchEvent (evt).
Var evt=document. CreateEvent (' HTMLEvents'); Evt. InitEvent (" input ", true, true); Document. The getElementById (' user - mobile). DispatchEvent (evt).
Var a=document. GetElementById (' code - the button).
A. d. isabled=false;
You see, the website is
http://mobile.yangkeduo.com/login.html
Although the color changed, but don't click

CodePudding user response:


This button point may be related to verification, the input number listening, when you enter does not meet the conditions out tips, meet the conditions of the time he will together with some other parameters, if does not meet the conditions were not allowed to request, just like we normally request, click edit to modify a form data, to accompany the data id, if the judge, don't send the request without this id

CodePudding user response:

refer to 6th floor front _ rookie response:

This button point may be related to verification, the input number listening, when you enter does not meet the conditions out tips, meet the conditions of the time he will together with some other parameters, if does not meet the conditions were not allowed to request, just like we normally request, click edit to modify a form data, to accompany the data id, without judgment, this id is not hair request


Question is manual input is no problem, you can point input 1

CodePudding user response:

Enter 1 can do check points, only have give you some value, basic digits check, cell phone number to reach 11 requests the backend will also have a phone number check, enter 1 click on the verification is not successful to send request, input full 11 digits can send the request, but the backend will check,
You don't have to struggle can he avoid, he is a check to meet the conditions for you to generate some data on an object, and is allowed to submit, your hand throw up did not trigger his data generated content, so click no effect

CodePudding user response:

refer to the eighth floor front _ rookie response:
enter 1 can do check point, only those who have give you some value, basic digits check, cell phone number to reach 11 requests the backend will also have a phone number check, enter 1 click on the verification is not successful to send request, input full 11 digits can send the request, but the backend will check,
You don't have to struggle can he avoid, he is a check to meet the conditions for you to generate some data on an object, and is allowed to submit, your hand throw up did not trigger his data generated content, so click no effect


Means how: can I make js analog input automatically submit mobile phone, how to write the js code

CodePudding user response:

That is to say, how to js, how to write, to trigger his check

CodePudding user response:

So hard so hard so hard so difficult
  • Related