|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Need some quick help
I'm having some issues retrieving a single variable...
i have a drop down box part of a form control a div layer that shows once the drop down has been changed. The variables in the drop down change are for the layer id and the value of the town. My issue is getting the town id pulled over to the div layer's link. This is the code for the switch which is in my head. Code: Code:
<script language="javascript">
function showhide(id,towns){
var town = towns;
if (document.getElementById){
obj = document.getElementById(id);
if (obj.style.display == "none"){
obj.style.display = "";
} else {
obj.style.display = "";
}
}
}
</script>
Here is my div currently where I am trying to pull the town id: Code: Code:
<div style="display: none;" id="script">
<img src="sac.jpg" border="0"><br>
<script language="javascript">document.write(town);</script><input type="button" name="category4" value="40" onClick="submitform();"> BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH
<br><br>
</form>
</div>
Anybody have a suggestion? |
|
#2
|
||||
|
||||
|
Am i reading this line right?
if (document.getElementById){ and where are you defining obj? and what is the pont of var town = towns;?
__________________
The liver is evil and must be punished! |
|
#3
|
|||
|
|||
|
Quote:
It would be so much easier to just write out towns. That's just worthless coding there. Also, if javascript is turned off. Bye bye to that. |
|
#4
|
||||
|
||||
|
I noticed several problems.
Last edited by Joseph Taylor : May 6th, 2008 at 04:34 AM. |
![]() |
| Viewing: Dev Shed Forums > Web Design > JavaScript Development > Need some quick help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|