/    Sign up×
Community /Pin to ProfileBookmark

<iframe> question

hello all. I am not a JavaScript programmer, so pls don’t scream at me.

here is my problem.
I have index.php and iframe.php. On index.php is an <iframe src=”iframe.php” name=”content” width=”100″ height=”100″></iframe>

On index.php i have a dropdown selCountry

[CODE]
<form name=”country” action=”submit.php” method=”post”>
<select id=”selCountry” name=”selCountry” onChange=”parent.content.location.href=iframe.php?selCountry=’+document.getElementById(‘selCountry’).value”>
/***********************************************
* here comes the PHP code to generate the dropdown list
***********************************************/
</select>
<input type=submit>
</form>
[/CODE]

with an onChange effect, that changes dropdown selCity

[CODE]
<form name=”city” method=”post”>
<select name=”selCity”>
/***********************************************
* here comes the PHP code to generate the dropdown list
***********************************************/
</select>
</form>
[/CODE]

located in the on the iframe.php.

When i select a country from selCountrry, it loads in selCity all cities from database that are from that country.
So far so good.

What I want (and I don’t know) is to make a JavaScript in index.php that catches the value of the selected selCity and when the <submit> button from index.php is hit, it sends the values to $db.
Maybe I could use a hidden field on index.php form that catches the value i need.

Hope i made my self clear.

Anyhow, help would be greatly apriciated.
Thx in advance

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @Think_Pink spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...