NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Enabling Disabled Buttons in JS

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search
5 members in live chat ~  


Closed Thread
 
LinkBack Thread Tools
Old 06-12-2004, 02:58 PM THREAD STARTER               #1 (permalink)
New Member
Join Date: Jun 2004
Location: Devon, England
Posts: 3
DanielGibbs is an unknown quantity at this point
 



Enabling Disabled Buttons in JS


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
__________________
<? $codename = $_POST["Codename: Up The Irons"]; ?>
DanielGibbs is offline  
Old 06-15-2004, 07:57 PM   #2 (permalink)
NamePros Expert
 
Anthony's Avatar
Join Date: Dec 2003
Location: NYC
Posts: 9,132
Anthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant future
 

Member of the Month
October 2004

Hmmm... You want it activated when what option is clicked?
Anthony is offline  
Old 06-16-2004, 07:08 AM   #3 (permalink)
Senior Member
Join Date: May 2003
Posts: 2,187
adam_uk is a jewel in the roughadam_uk is a jewel in the roughadam_uk is a jewel in the rough
 


Breast Cancer
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
adam_uk is offline  
Old 07-03-2004, 07:40 PM   #4 (permalink)
NamePros Member
Join Date: Jul 2004
Location: Clackamas, OR
Posts: 75
cutterofcloth is an unknown quantity at this point
 



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:
????: NamePros.com http://www.namepros.com/programming/33845-enabling-disabled-buttons-in-javascript.html
<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>
cutterofcloth is offline  
Old 07-03-2004, 07:56 PM   #5 (permalink)
Senior Member
 
iDeviseFlash's Avatar
Join Date: Jun 2004
Posts: 1,030
iDeviseFlash will become famous soon enoughiDeviseFlash will become famous soon enough
 



that looks good. Ya, If statements work wonders!
__________________
~*~* SIG FOR SALE *~*~
Click here...
iDeviseFlash is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


 
All times are GMT -7. The time now is 02:22 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger