/    Sign up×
Community /Pin to ProfileBookmark

Fullscreen function won’t work right

I am trying to get the following code to work right. I want google maps website to open in a new window with the entered values. Currently the code doesn’t open a new window but add the vales to the current link that this code is on. Does anyone see anything wrong?

[CODE]<script>
<– function call_full(){
var saddr=document.getElementByID(‘saddr’).value;
var daddr=document.getElementByID(‘daddr’).value;
fullScreen(‘http://maps.google.com/maps?saddr=’+saddr+’&daddr=’+daddr);}
//–>
</script>

<form name=”addr_form” id=”addr_form”>
<b>Get Directions</b><br><font size=2>Your address: (street, town, state)</font><br>
<input type=”text” SIZE=40 MAXLENGTH=40 name=”saddr” id=”saddr” value=”” />
<input value=”Go” TYPE=”submit” onclick=”call_full();”>
<input type=”hidden” name=”daddr” value=”40.000000″, “80.000000”/> [/CODE]

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@A1ien51Oct 31.2006 — And what is the function fullScreen?

Eric
Copy linkTweet thisAlerts:
@A1ien51Oct 31.2006 — And you are also calling the form fields before they are even rendered since you removed the function.

Eric
Copy linkTweet thisAlerts:
@outdoorxtreme1authorOct 31.2006 — I'm kinda new at this and I am trying to get a new window to open full screen with some data from the input field.

Do I need to add this to my script also?

[CODE]var str = "left=0,screenX=0,top=0,screenY=0";

if (window.screen) {

var ah = screen.availHeight - 30;
var aw = screen.availWidth - 10;
str += ",height=" + ah;
str += ",innerHeight=" + ah;
str += ",width=" + aw;
str += ",innerWidth=" + aw;

} else {
str += ",resizable"; // so the user can resize the window manually
}

function fullScreen(theURL) {
return window.open(theURL, '', str);
}[/CODE]
Copy linkTweet thisAlerts:
@outdoorxtreme1authorOct 31.2006 — Heres how I want it to work but I can't seem to get the var daddr and saddr data to work right.

[CODE]echo "<script language="Javascript">
<!--
var str = "left=0,screenX=0,top=0,screenY=0";
if (window.screen){
var ah = screen.availHeight - 30;
var aw = screen.availWidth - 10;
str += ",height=" + ah;
str += ",innerHeight=" + ah;
str += ",width=" + aw;
str += ",innerWidth=" + aw;
} else {
str += ",resizable";
}
function fullScreen() {
var saddr=document.getElementByID('saddr').value;
var daddr=document.getElementByID('daddr').value;
window.open( "http://www.google.com/maps?saddr='+saddr+'&daddr='+daddr+'", "", str )
}
//-->
</script>";
echo '<form name="addr_form" id="addr_form">
<b>Get Directions</b>
<br>
<font size=2>Your address: (street, town, state)</font><br>
<input type="text" size=40 maxlength=40 name="saddr" id="saddr" value="" />
<input type="button" type="submit" onClick="fullScreen()" value="Go">
<input type="hidden" name="daddr" value="'.$row['lat']. ", " .
$row['lon'].'"/>
</form>';[/CODE]
×

Success!

Help @outdoorxtreme1 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.18,
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,
)...