/    Sign up×
Community /Pin to ProfileBookmark

Load Webpage in JS

Hi Could someone please help me to have the webpage loaded when the condition is met >39
<!DOCTYPE html>
<html>
<body>

<h2>HTML Forms</h2>

<form action=”” onSubmit=”myFunction()”>
<label for=”fname”>First name:</label><br>
<input type=”text” id=”fname” name=”fname” value=””><br>
<label for=”lname”>Last name:</label><br>
<input type=”text” id=”lname” name=”lname” value=””><br><br>
<input type=”submit” value=”Submit”>
</form>
<script type=”text/javascript”>
function myFunction(){
var fname = document.getElementById(“fname”).value;
if(fname > 39) {
loadPage(‘http://www.mdrtrust.co.za‘);>Home<div>
} else
alert(“Condition Not met”)
}
</script>

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@daveyerwinAug 17.2020 — @marius123#1622218

you have a couple of problems

for one loadPage is not defined

two ...

loadPage('http://www.mdrtrust.co.za');>Home<div>

this part, >Home<div> is in error
Copy linkTweet thisAlerts:
@marius123authorAug 18.2020 — Thank you for the reply. Could you please help me to rectify it
Copy linkTweet thisAlerts:
@SempervivumAug 18.2020 — As far as I'm concerned I'm usure about what your intention is:

Embed that website in your own one

or

simply forward or redirect to that site?
×

Success!

Help @marius123 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.25,
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,
)...