Click to See Complete Forum and Search --> : Blake's grab bag of questions


GamerBlake
07-02-2003, 02:02 AM
I'm redesigning my site atm, and have a few questions on some small problems that I'd like some help on.

As I have a few questions and I'm unsure as to what the solutions to these may/will be, I'm posting it in the general section.

First off, I have a test page up here:
http://www.unrealnintendonews.com/preview.shtml

Ok, first question:

1. On that test page I have a search option (thanks to freefind.com) at the bottom of the nav bar on the left.

What I'd like to do is have a clickable image instead of the standard "submit" button, and was wondering if that was even possible? Also, is there a way to customise the font/bg colour of a normal form button? (Any resources on this issue would also be appreciated, assuming they exist).

2. I'd like to be able to have a popup window open on (and only) the front page of the site, and would usually use JavaScript. The problem is that I'm using server side includes to load a lot of code, including the <body> tag on every page, and obviously, using an OnLoad= command in it would load it on every page.

So what I'm wondering is if anyone knows of some type of code I can insert into the front page shtml that will open a popup window without using the <body> tags?


Any help on these issues appreciated.

Charles
07-02-2003, 05:24 AM
1) <input type="image" src="http://forums.webdeveloper.com/avatar.php?userid=264&dateline=1050158436" alt="submit">

<input type="submit" style="padding:2em; background-color:#800; color:#aaa; font-weight:bold">

<button type="submit"><img src="http://forums.webdeveloper.com/avatar.php?userid=264&dateline=1050158436" alt="submit"></button>

<button type="submit" style="padding:2em; background-color:#800; color:#aaa; font-weight:bold">Submit</button>

2) <script type="text/javascript">
<!--
onload = function () {window.open('http://www.w3.org')}
// -->
</script>

GamerBlake
07-03-2003, 08:52 PM
Thanks a lot, that works well, but two follow-up questions:

This is what I have the search form looking like now:

http://www.unrealnintendonews.com/box1.gif

I was wondering if it would be possible to do something to make it look like this mock up I made in paint:

http://www.unrealnintendonews.com/box2.gif

Basically wondering if you can set the pixel height of the input area? (and the font of any text you have load in it?).


That popup code works nicely, but I would like to be able set the window size, scrollbars on/off, screen location etc? Can you do that with this code, or does that require a more advanced version?

Hester
07-04-2003, 04:11 AM
Avoid using pop-up windows. They are blocked by many browsers including an add-on for IE. So many people will not see the pop up.

Charles - aren't there accessibility concerns here also?

Charles
07-04-2003, 04:59 AM
<input type="text" style="height:50px; font-size:40px">

And yes, 13% of users do not use JavaScript and unnumbered masses block pop-ups. But if you implement the pop-up properly then you can have a link that works normally for those happily pop-up free folks.

<a href="http://www.w3.org/" onclick="window.open(this.href, 'child', 'height=400,width=300'); return false">W3C</a>

GamerBlake
07-06-2003, 01:01 AM
Ok, I'm quite happy with how my search box turned out (bottom of navbar on left) (http://www.unrealnintendonews.com/preview.shtml). Took me a while to work out the finer points though.. ;)

I'm still having trouble with that popup code though.

I'd like to use the first one you posted (not the one with the link you have to click), but I'm not sure how to implement the dimensions I need.

Here's the code from the onload popup code I was using:



eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=0,width=653,height=520,left = 73.5,top = 0');");


Could those specifications be used in conjunction with the first popup code you posted Charles?

Charles
07-06-2003, 06:51 AM
1) Unless you really know what you are doing you are doing something wrong if you are using the "eval" function.

2) 13% of users do not use JavaScript and some of those good people cannot use JavaScript because of some disability. It's important to not make a page that relies upon JavaScript, especially for navigation. If you are doing what I think you are doing, you will need a short little server side script to return a redirect HTTP header.

3) When specifying window geometry there shouldn't be any spaces and the numbers are in pixels. You cannot have half of a pixel.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Content-Script-Type" content="text/javascript">
<form action="someScript.pl" onsubmit="window['page' + id] = window.open(this.action, 'id', 'width=653,height=520,left=73,top=0,scrollbars,statusbar'); return false">
<div>
<input type="image" src="http://forums.webdeveloper.com/avatar.php?userid=264&dateline=1050158436" alt="submit">
</div>
</form>

GamerBlake
07-06-2003, 10:16 AM
I'm not sure what you think I'm doing, but all I want is to have a fake "wacky" popup ad come up on the front page. If some users don't see it it's really not that much of a problem.

The partial code I posted was from the old code I was using, which was simply cut and pasted from http://javascript.internet.com/. No, I really don't know much more than basic html and ctrl + p ;), that's why I'm here.

I'll give the new code a shot.

Charles
07-06-2003, 11:15 AM
Originally posted by GamerBlake
I want is to have a fake "wacky" popup ad come up on the front page. That's still not enough information. How do you want to launch the popup? How will you determine what will be in the window? Will you be closing the window? Will you be reusing the window?

GamerBlake
07-06-2003, 03:19 PM
Never mind, I've just decided to go with clicking links to load them (as opposed to the page loading).

http://www.unrealnintendonews.com/archive/fakeadsarch.shtml

Thanks anyway. :)