Avatar of srbarker8
srbarker8Flag for Canada

asked on 

I need to update a form field from an inline frame javascript

Hi there.

It's not really easy for me to post the entire code for this, so I will try to clearly describe my problem...

I need some help rigging up a javascript to update a form field in my main form from an inline frame href..

On my main html document, my main form's id is ...  <form id='adm_edit' ... etc.. >

The form field that I want to update is ...

<input id='txtAddress_Code'>

Now, the user clicks a link on the main page which opens a lookup form inside of an inline frame .... They can do a lookup in our database there.  

I am trying to update the value of the form field in the main form from my inline frame...

So, I am trying to update  adm_Edit.txtAddress_Code.value in a javascript function in my inline frame page's code.

I basically want to have a jscript line that does...

??????.adm_edit.txtAddress_Code.value = 12345;

But I do not know how to correctly set the ??????? part ... is it self or frames[ .. or ... ???

Please help.

Thx Scott
Web Languages and StandardsJScriptHTML

Avatar of undefined
Last Comment
Avatar of scrathcyboy
Flag of United States of America image

Blurred text
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of srbarker8
Flag of Canada image


Thx.  That works great.
By the way, what is a good method or tool for investigating the dom when I'm trying to figure these kinds of things out?
Thx Scott
Avatar of scrathcyboy
Flag of United States of America image

IN firefox, there is a menu choice -- Tools, Error Console.
It will report all javascript errors, especially with these kinds of issues, as well as HTML and DOM errors, in real time.  You just CLEAR the display, then refresh the page you are debugging, and all coding errors are right there.  Good luck.

HTML (HyperText Markup Language) is the main markup language for creating web pages and other information to be displayed in a web browser, providing both the structure and content for what is sent from a web server through the use of tags. The current implementation of the HTML specification is HTML5.

Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews


IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo