and now on the same page I have iframe which contain a form. This form contains a hidden input called customer-name whose value needs to the value of custname. The iframe has id called "iFrame1"
You're also getting an error about the $ not being defined - this can happen if you've re-assigned the standard jQuery $ to something else. If that's the case, then you'll need to change the jQuery to use whatever you've assigned it to.
niceoneishere
ASKER
Thanks for looking into to it. I added the id for the hidden input customer-name but I am not sure how to find the jQuery $ assigned
Chris Stanyon
Probably easiest to just use the full named jQuery reference rather than the shorthand $.
Yeah - I've just tried it on a different computer and it didn't work. Not sure if your document.ready block is firing or not.
One possibility is that the document.ready block is being fired when the main document is ready, but before the iFrame content is ready - this would mean that the input inside the iFrame isn't available when the jQuery code fires.
As a test, add an simple console.log line into the document ready block to make sure it's being fired. Something like this:
If the doc.ready block is being fired, you'll see John Doe being output to the console, which would confirm my suspicions that it's being fired too early.
If that is the case, we'll need to find another solution.
niceoneishere
ASKER
Wow thanks for looking into it again, and yes its being fired too early as the console returns John Doe. I wondering if there is way to grab the main page value from the iframe like the iframe is ready or onload grab the value
Open in new window