/    Sign up×
Community /Pin to ProfileBookmark

onClick ( Can’t Get It to work )

This is how I do a onclick to open in a new window.

onClick=”window.open(‘file.html’)”

How do I do it so it will open the .html file in the parent window, in the current location, just like a plain href without a target! I must be doing something wrong, please help.

Thanks.

to post a comment
JavaScript

12 Comments(s)

Copy linkTweet thisAlerts:
@96turnerriFeb 12.2004 — onclick="window.location='file.htm';"
Copy linkTweet thisAlerts:
@d_brandusaauthorFeb 12.2004 — DUH! Omg I think my brain is fried, thanx alot man.

Here is another wierd question, is it possible to tell it to underline onmouseover and onmouseout no undersline?

is this possible?

DB
Copy linkTweet thisAlerts:
@96turnerriFeb 12.2004 — <head>

<style type="text/javascript">

a:link, a:visited, a:hover {

text-decoration: none;

}

a:hover {

text-decoration: underline;

}

</style>

</head>
Copy linkTweet thisAlerts:
@d_brandusaauthorFeb 12.2004 — I understand it works in css but I need it to do a onmouseover and onmouse out, I am pulling data thru in input field on my form so after they click submit the next page shows the data, but I want them to be able to click on the input field for one thing that goes to the url which works now, but would like it to underline like a normal href link.

<input name="Username" type="text" class="textfield" id="Username" onFocus="this.blur();" size="13" style="color: #5D037B; border: 0px solid #F7DB92; background-color: #FFFFFF; font-size:8pt" value="<%=(rsTelephoneTrackingDataSheet.Fields.Item("Username").Value)%>" onclick="window.location='phone_tracking_detailed.asp?<%= MM_keepURL & MM_joinChar(MM_keepURL) & "Username=" & rsTelephoneTrackingDataSheet.Fields.Item("Username").Value %>';'">

So now it clicks the url fine but I still get the plain "select cursor" so esentially I would like it to make an arrow cursor and underline while hovered like a normal link, is this possible?

DB
Copy linkTweet thisAlerts:
@Paul_JrFeb 12.2004 — <i>
</i>&lt;input type="text" id="text1" onmouseover="this.style.textDecoration='underline'; this.style.cursor='pointer';" onmouseout="this.style.textDecoration='none'; this.style.cursor='default';" value="Some text." /&gt;

Also, 96turnerri, I fail to see why you would define the :hover styles twice...
Copy linkTweet thisAlerts:
@d_brandusaauthorFeb 12.2004 — Thanks so much, that is PERFECT, you guys rock!

To tell you the truth I have never had such professional help!

Keep up the awesome work guys.

DB
Copy linkTweet thisAlerts:
@96turnerriFeb 12.2004 — the first a:hover is a type sorry :rolleyes:
Copy linkTweet thisAlerts:
@Paul_JrFeb 12.2004 — [i]Originally posted by 96turnerri [/i]

[B]the first a:hover is a type sorry :rolleyes: [/B][/QUOTE]

Ah, okay. Many pardons.

[i]Originally posted by d.brandusa[/i]

[b]Thanks so much, that is PERFECT, you guys rock!

To tell you the truth I have never had such professional help!



Keep up the awesome work guys.



DB[/b]
[/quote]

You're quite welcome. Just glad I was able to help out. ?
Copy linkTweet thisAlerts:
@96turnerriFeb 12.2004 — same here, thanks for the for the pardons paul ?
Copy linkTweet thisAlerts:
@d_brandusaauthorFeb 12.2004 — Actually not so fast SMARTY PANTS! HEHEHE I have one last question, when you do a href you are able to use alt=TEXT can you do the same for the form field, on the basis of onmouseover alt=information?

DB
Copy linkTweet thisAlerts:
@fredmvFeb 13.2004 — &lt;input type="text" [color=blue][b]title="foo" [/b][/color]/&gt;
×

Success!

Help @d_brandusa 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.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: @nearjob,
tipped: article
amount: 1000 SATS,

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

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