Form question

C

Cogito

The following form (which I copied from somewhere) consists of one
button only:

<form>
<input type=button value="Solution" style="background-color: d7dcc5"
onClick="window . open ('solution.html', '',
'width=300,height=450');">
</form>

My questions are:
1. How do I set the font size and color?
2. The pop-up window appears at the top left corner of the screen. Is
it possible to set a different location?
 
D

David Dorward

Cogito said:
The following form (which I copied from somewhere) consists of one
button only:

<form>
<input type=button value="Solution" style="background-color: d7dcc5"
onClick="window . open ('solution.html', '',
'width=300,height=450');">
</form>

A very nasty, inaccessible way of doing:

<a href="solution.html"
onclick="if(window.open){window.open(this.href,'myWindow',width=300,height=450');return
false;}else{return true;}">Solution</a>

The code you provided also happens to have a number of syntax errors.
My questions are:
1. How do I set the font size and color?

Same as any other element:
http://www.w3.org/TR/CSS2/fonts.html#font-size-props
http://www.w3.org/TR/CSS2/colors.html#colors
2. The pop-up window appears at the top left corner of the screen. Is
it possible to set a different location?

In ordef or preference:

(1) Don't use a popup window
(2) Don't use a popup window (Yes, I know I put this one twice. It is a VERY
good solution to the problem)
(3) Get a better windowing system that places the window somewhere you're
happier with
(4) Muck about with the "moveto()" function in the onload event of the
document you are loading in to the new window.
 
M

Matthias Gutfeldt

Cogito said:
The following form (which I copied from somewhere) consists of one
button only:

<form>
<input type=button value="Solution" style="background-color: d7dcc5"
onClick="window . open ('solution.html', '',
'width=300,height=450');">
</form>

My questions are:
1. How do I set the font size and color?
2. The pop-up window appears at the top left corner of the screen. Is
it possible to set a different location?

Funny... in the last couple days we've had a lot of really newbie form
styling questions. Is this some school assignment, and the teacher sent
you here for a free helpdesk, or is it just coincidence?


Matthias
 
C

Cogito

A very nasty, inaccessible way of doing:

<a href="solution.html"
onclick="if(window.open){window.open(this.href,'myWindow',width=300,height=450');return
false;}else{return true;}">Solution</a>

The code you provided also happens to have a number of syntax errors.


Same as any other element:
http://www.w3.org/TR/CSS2/fonts.html#font-size-props
http://www.w3.org/TR/CSS2/colors.html#colors


In ordef or preference:

(1) Don't use a popup window
(2) Don't use a popup window (Yes, I know I put this one twice. It is a VERY
good solution to the problem)
(3) Get a better windowing system that places the window somewhere you're
happier with
(4) Muck about with the "moveto()" function in the onload event of the
document you are loading in to the new window.

Thanks for your reply.
I'm always eager to learn new and better ways of coding.
When I incorporate your code sample it create a simple hyperlink to
the solution page… nothing fancy despite the apparent 'complexity' of
the code. Was it meant to create a pop-up or not? It seems as though
the 'onclick' code does not do much..
 
D

David Dorward

When I incorporate your code sample it create a simple hyperlink to
the solution page… nothing fancy despite the apparent 'complexity' of
the code. Was it meant to create a pop-up or not? It seems as though
the 'onclick' code does not do much..

I missed off a "'" immediately before 'width', add it and it creates an
annoying popup.
 
C

Cogito

ok, a new window now pops-up AND the main window changes as well.
Not here. That's what all the return false stuff is about.

The moment you said, "That's what all the return false stuff is
about." I figured it out.
In your first reply the word "return" was at the end of the line and
the word "false" was in a new line immediately following it without a
space in between. Now that I have added the space it works fine.

Thanks for showing me how to do it. (What was wrong with my old code?
it worked well too.).
Now I feel guilty about using pop-ups and will probably not use it…

It's not online yet. Just playing with it on my machine.
 
C

Chris Morris

Cogito said:
Oh, I thought everyone has Javascript.

No search engines have it, no text-based browser has it (though elinks
are working on it, I believe), every browser with it has an option to
disable it (though it's well-hidden in Internet Explorer), some
firewalls/proxies strip it out for security reasons.
What language is the new code in?

Javascript still, but this time with a HTML alternative that gets used
if Javascript is disabled or unavailable.

Now all you have to do is think of an alternative for users with
Javascript enabled, but pop-ups disabled (in a broad as opposed to
non-requested suppression, which is the only option in a lot of
browsers/3rd party apps).
 
D

David Dorward

Chris said:
I knew it (and CSS support) were on their todo list. I've not been
keeping up, obviously. Right, that's another new browser for my
collection :)

Links makes a great browser for a cheap web browser kiosk. Take Linux, add
in a 1024x760 or 800x600 framebuffer console, GPM (mouse driver), and Links
and you have a mouse driven, graphical browser. I haven't tested it, but it
would probably run comfortably on something as low powered as a 386. (No
need for X at all). You could probably cram the entire system in to about
6MB and run it from compact flash.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top