Hi there everyone !
I'm new at
Js, so don't be cruel...
I have a big form and in certain part of it a link that makes a hidden layer to become visible with an aditional and independent small form that takes some values from the half filled big form into hidden fields...
- Code: Select all
<table>
<tr><td>
<input name="street" id="street" size="30" maxlength="100" />
</td><tr>
<tr><td>
<input name="city" id="city" size="30" maxlength="100" />
</td></tr>
</table>
Next to this point there's a link to show a hidden layer which contains the small form:
- Code: Select all
<a href="#" onClick="showmenow('formurba','visible')">Extra details</a>
This link invokes following function:
- Code: Select all
function showmenow(object,val) {
document.getElementById(object).style.visibility = val;
var local = document.getElementById("SubCat");
var street = document.getElementById("street");
var city = document.getElementById("city");
street2.value = street.value;
city2.value = city.value;
}
After this, I try to show the values in the just appeared layer, but nothing happens, document.write, doesn't work and hidden fields don't get filled...
- Code: Select all
<div id="formurba">
<SCRIPT Language="JavaScript">
document.write("Street name :" + street + "Cuty name : " + city)
</SCRIPT>
<input type="hidden" name="street2" id="street2" value="">
<input type="hidden" name="city2" id="city2" value="">
</div>
I don't even get the "Street name :" string, only if I remove the var from the document.write line...
Why??
