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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing Values to Hidden

Status
Not open for further replies.

visitor99

IS-IT--Management
Jun 29, 2001
3
GB
Need a little help I am passing values from a scrolling textbox in one form to a type hidden in another form... I am using a simple function to move these values and it seems to work fine in IE but in Netscape it doesn't work...
 
because the document object model are differents
check for cross browser and/or DOM issues in the threads or post the code you're actually using
 
Thanks for the suggestions, I couldn't seem to find anything that helps me out.... Here is some of the code

//Move Function

<script language=&quot;Javascript&quot;>
function MoveIt() {
var z=document.all.hospital.value = document.all.hospblank.hospital2.value

}
</script>

//First Form with hidden type

<form method=&quot;POST&quot; name=&quot;inputForm&quot; action=&quot;sub.asp&quot; onsubmit=&quot;MoveIt()&quot;>
<input type=&quot;hidden&quot; name=&quot;hospital&quot; value>
</form>

//second Form with value from scrolling textbox

<div class=&quot;test&quot; id=&quot;rnd&quot;>

<form method=&quot;POST&quot; id=&quot;hospblank&quot;>
<table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; width=&quot;439&quot;>
<tr>
<td><small><textarea rows=&quot;7&quot; name=&quot;hospital2&quot; cols=&quot;47&quot; tabindex=&quot;15&quot; size=&quot;20&quot;></textarea></small></td>
</tr>
</table>
</form>
</div>


 
try this :

function MoveIt() {
if (document.all) // then it's ie 4+
var z=document.all.hospital.value = document.all.hospblank.hospital2.value
else // might be ns 4+
(°) var z=document.layers.hospital.value=document.layers.hosblank.hospital2.value
}

OR replace the line (°) with :
z=document.hospital.value=document.hospblanck.hospital2?value

and this should be fine

 
sorry, the ? is actually a . in
z=document.hospital.value=document.hospblanck.hospital2.value
 
Thanks for all your help, But i have been playing around with this for a couple of days and i still can't get it to work... Any other suggestions
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top