/    Sign up×
Community /Pin to ProfileBookmark

JAVASCRIPT-new window

HI I am creating a javascript online form.

Can somebody send me the full code,

when somebody enters there name into an input box and selects a resisdence from a list box, this should display into a new window showing their name and resisdence ENTERED and SELECTED.

PLEASE SEND AS SOON AS POSSIBLE

THANK YOU

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@cgishackFeb 09.2008 — Usually I would not reply to a posting that was written like this, but i am in a good mood.

I would look at re wording your post next time. This one seems kind of demanding.

here is a piece of what you are looking for

Page 1:
<i>
</i>&lt;html&gt;
&lt;head&gt;
&lt;title&gt;&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;script&gt;

var name, residance;

function displayInWindow()
{
name = document.getElementById("name").value;
var res = document.getElementById("res");
residance = res.options[res.selectedIndex].text;

<i> </i>window.open("somePage.htm","_blank","width=300, height=300");
}

&lt;/script&gt;


<i> </i>&lt;input name="name" type="text" id="name" /&gt;
<i> </i> &lt;select id="res"&gt;
<i> </i> &lt;option&gt;House&lt;/option&gt;
<i> </i> &lt;option&gt;Apt&lt;/option&gt;
<i> </i> &lt;option&gt;Cottage&lt;/option&gt;
<i> </i> &lt;/select&gt;
<i> </i>&lt;input type="button" value="Submit" onclick="displayInWindow()" /&gt;
&lt;/body&gt;
&lt;/html&gt;



Page 2 (named 'somePage.htm)
<i>
</i>&lt;html&gt;
&lt;head&gt;

&lt;title&gt;&lt;/title&gt;
&lt;/head&gt;

&lt;body&gt;
&lt;script&gt;


document.write(window.opener.name);
document.write("&lt;br/&gt;");
document.write(window.opener.residance);
&lt;/script&gt;


&lt;/body&gt;
&lt;/html&gt;



There is no error checking.

Drew
×

Success!

Help @rsolanki100 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 5.17,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...