[help] Javascript For enabling button
2013-11-10, 12:49 AM,
#1
So i am just trying to enabling a disabled button using javascript. Here are my codes.

Plz correct me what i am doing wrong. My button remains disabled even if i type 123 in textbox
Reply
2013-11-10, 05:09 PM,
#2
looking for answer plz. new to javascript .i am able to enable button on textchange but for specific text value (like 123) button stays disabled
Reply
2013-11-10, 05:33 PM, (This post was last modified: 2013-11-10, 05:35 PM by Atlantis.)
#3
What exactly do you want? Please try to explain it better.
EDIT: I get it. I'll see if I can fix it for you


[Image: wI9cuAG.png]
Reply
2013-11-10, 05:36 PM,
#4
HTML:
Code:
Activation Key: <input type="text" size="10" onkeyup="myFunction()" id="act">
<a href="#" target="_blank"><button id="myButton" disabled >Activate</button> </a>

Javascript:
Code:
function myFunction()
{
var textInput = document.getElementById('act').value;
if (textInput == "123")
{
document.getElementById("myButton").disabled=false;
} else {
document.getElementById("myButton").disabled=true;
}
}
Latest Thanks - View all

lastbencher9(2013-11-10 05:42 PM) 
Reply
2013-11-10, 05:40 PM,
#5
I think this is what you want?
http://jsfiddle.net/Atlantis3/Y9Rqm/5/
Latest Thanks - View all

lastbencher9(2013-11-10 05:45 PM) 


[Image: wI9cuAG.png]
Reply
2013-11-10, 05:43 PM,
#6
(2013-11-10, 05:36 PM)Springfire Wrote: HTML:
Code:
Activation Key: <input type="text" size="10" onkeyup="myFunction()" id="act">
<a href="#" target="_blank"><button id="myButton" disabled >Activate</button> </a>

Javascript:
Code:
function myFunction()
{
var textInput = document.getElementById('act').value;
if (textInput == "123")
{
document.getElementById("myButton").disabled=false;
} else {
document.getElementById("myButton").disabled=true;
}
}
tnx for ur efforts i tried ur codes in jsfiddle bt button remains disabled.
Reply
2013-11-10, 05:47 PM,
#7
(2013-11-10, 05:43 PM)lastbencher9 Wrote:
(2013-11-10, 05:36 PM)Springfire Wrote: HTML:
Code:
Activation Key: <input type="text" size="10" onkeyup="myFunction()" id="act">
<a href="#" target="_blank"><button id="myButton" disabled >Activate</button> </a>

Javascript:
Code:
function myFunction()
{
var textInput = document.getElementById('act').value;
if (textInput == "123")
{
document.getElementById("myButton").disabled=false;
} else {
document.getElementById("myButton").disabled=true;
}
}
tnx for ur efforts i tried ur codes in jsfiddle bt button remains disabled.

No way, it will enable on typing 123

http://jsbin.com/EZOxaPOG/1/edit?html,js,output
Latest Thanks - View all

lastbencher9(2013-11-10 05:48 PM) 
Reply
2013-11-10, 05:47 PM, (This post was last modified: 2013-11-10, 05:51 PM by lastbencher9.)
#8
(2013-11-10, 05:40 PM)Atlantis Wrote: I think this is what you want?
/Atlantis3/Y9Rqm/5/
Bro tnx for your time i found the same codes in google search and its working . it enables the button if u type anything inside the textbox. but i want specific value to be typed like 124545 to enable the button.
your codes simly enables button on text change.

No way, it will enable on typing 123

/EZOxaPOG/1/edit?html,js,output
[/quote]

yeah man its worked now tnx a lot mwahaSmile Kiss tnxxx SPRINGFIRE
Reply
2013-11-10, 05:57 PM,
#9
(2013-11-10, 05:47 PM)lastbencher9 Wrote:
(2013-11-10, 05:40 PM)Atlantis Wrote: I think this is what you want?
/Atlantis3/Y9Rqm/5/
Bro tnx for your time i found the same codes in google search and its working . it enables the button if u type anything inside the textbox. but i want specific value to be typed like 124545 to enable the button.
your codes simly enables button on text change.

No way, it will enable on typing 123

/EZOxaPOG/1/edit?html,js,output

yeah man its worked now tnx a lot mwahaSmile Kiss tnxxx SPRINGFIRE
[/quote]

It will work on jsfiddle too, just choose "No wrap - in <head>" on the left. But I really have no idea what this does.

Anyway, you may use jsbin.com, its better with live preview!
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Button + iframe hopsa 3 312 2017-09-21, 07:18 PM
Last Post: FlyingCactus
  Mobile traffic redirect after clicks on button Warriorcpa 2 1,149 2016-10-01, 05:54 PM
Last Post: Warriorcpa
  [SHARE} High Quality Javascript ALERTS! Mimo 0 1,057 2016-07-11, 05:13 PM
Last Post: Mimo
  i need help in button Cpagrip vip2 6 1,032 2015-11-24, 07:38 PM
Last Post: SiriusBlack
  Anyone good with Javascript? hawdaze 6 889 2015-11-09, 11:43 PM
Last Post: serpkiller





About Us | Contact Us | CPA Elites | Advertise | Stats | Staff Team

© 2013-2017 CPA Elites Ltd
Enhanced by MyBB and WallBB
Return to top