Unstoppable Domains โ€” Expired Auctions

Enabling Disabled Buttons in JS

Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
Watch
Impact
0
Hi, I don't know javascript so here goes.

I've created a drop down menu and when a user selects a certain option and clicks the submit button a load of information is printed about the option (in PHP).

I have a disabled button called 'button' lol and I want it to be enabled when a user clicks a certain option in the drop downlist. I tried button.disabled=false as a random guess but as I said I don't know JS lol. Worth a try.

If you can help that'd be great!

Thanks! Dan G!bbs
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Hmmm... You want it activated when what option is clicked?
 
0
•••
on the <select> tag add this

onchange='window.open(this.value,"_self")'

on your options (<option>) you should set the value as the page you want to go to
 
0
•••
Haha I suppose it's too late, but I played with this for a few minutes and got this.
Script:
function dis() {
var nah = document.frm.sel.value;
if(nah == "true"){ document.frm.lol.disabled = true; }
if(nah == "false"){ document.frm.lol.disabled = false; }
}

form:
<form name="frm">
<select name="sel" onChange="dis()">
<option> - </option>
<option value="false">Enable</option>
<option value="true">Disable</option>
</select>
<br /><br />
<input type="button" name="lol" value="Hello" onClick="alert('hello');">
</form>
 
0
•••
that looks good. Ya, If statements work wonders!
 
0
•••
Truehost โ€” .com domains from $4.99, hosting includedTruehost โ€” .com domains from $4.99, hosting included
Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back