Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Popup menu and text disableing and a book question

Status
Not open for further replies.

bildx

Technical User
Jan 14, 2003
2
DE
Hello,

I tried unsuccessfully using previous posted thread to write a small script that will disable one the components (text field, pop-up menu). if text field ’m’ as input then pop-up menu ’d’ will be disabled and the opposite (m will be disabled if chosen d is different then value=" "). Can someone assist me please?

What is the best beginner book in order to study JavaScript?

Thanks.

HTML:
<html>
<head>
<title>m/d</title>
</head>
<body>
man.
<input name=&quot;m&quot; type=&quot;text&quot; id=&quot;m&quot;>
dyn.
<select name=&quot;d&quot; size=&quot;1&quot; id=&quot;d&quot;>
<option value=&quot; &quot;></option>
<option value=&quot;a&quot;>a</option>
<option value=&quot;b&quot;>b</option>
<option value=&quot;c&quot;>c</option>
</select>
</body>
</html>
 
I have no idea about the disabling problem, but about the book try:
JavaScript for the World Wide Web: Visual QuickStart Guide
 
Disabling is not my strong field and I always finding it a problem (someone should write a cookbook).

For a book are try: JavaScript: A Beginner's Guide by John Pollock.
 
Hi bildx
Is this something like you are looking for?
Code:
<html>
<head>
<title>m/d</title>
<script>
function disable_m(){
	if (d.value!=&quot; &quot;){
		m.disabled=true;
	}
}
function disable_d(){
	d.disabled=true;
}
</script>
</head>
<body>
man.
<input name=&quot;m&quot; type=&quot;text&quot; id=&quot;m&quot; onChange=&quot;disable_d()&quot;>
dyn.
<select name=&quot;d&quot; size=&quot;1&quot; id=&quot;d&quot; onChange=&quot;disable_m()&quot;>
  <option value=&quot; &quot;></option>
  <option value=&quot;a&quot;>a</option>
  <option value=&quot;b&quot;>b</option>
  <option value=&quot;c&quot;>c</option>
</select>
</body>
</html>
Hope I helped / Thanks for helping
if ((Math.abs(x)<10&&Math.abs(y)<10) &&(((parseIntx.toString()+y.toString())-x-y)%9)!=0)){alert(&quot;I'm a monkey's uncle&quot;);}
 
Hi,

Thanks it open a bit my eyes, but the selection is not reversible. Meaning that if I erase manually all the content of &quot;m” I can not choose something form “d” since it is disable. The phenomenon also occur when I choose a,b or c in the drop down list and when I choose later “ “, field text m is still disabled.

How can I solve this problem and make the selection process more flexible?

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top