Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Form question

Reply
Thread Tools

Form question

 
 
Cogito
Guest
Posts: n/a
 
      09-04-2003
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?

 
Reply With Quote
 
 
 
 
David Dorward
Guest
Posts: n/a
 
      09-04-2003
Cogito wrote:

> 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,'my Window',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.

--
David Dorward http://dorward.me.uk/
 
Reply With Quote
 
 
 
 
Matthias Gutfeldt
Guest
Posts: n/a
 
      09-04-2003
Cogito wrote:
> 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

 
Reply With Quote
 
Cogito
Guest
Posts: n/a
 
      09-04-2003
On Thu, 04 Sep 2003 07:33:09 +0100, David Dorward <>
wrote:

>Cogito wrote:
>
>> 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,'m yWindow',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.


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..

 
Reply With Quote
 
David Dorward
Guest
Posts: n/a
 
      09-04-2003
Cogito wrote:

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


> 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.

--
David Dorward http://dorward.me.uk/
 
Reply With Quote
 
Cogito
Guest
Posts: n/a
 
      09-04-2003
On Thu, 04 Sep 2003 11:59:41 +0100, David Dorward <>
wrote:

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

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


But it still does not pop.
 
Reply With Quote
 
David Dorward
Guest
Posts: n/a
 
      09-04-2003
Cogito wrote:

> But it still does not pop.


It does here, what's your URI?

--
David Dorward http://dorward.me.uk/
 
Reply With Quote
 
Cogito
Guest
Posts: n/a
 
      09-04-2003
ok, a new window now pops-up AND the main window changes as well.
 
Reply With Quote
 
David Dorward
Guest
Posts: n/a
 
      09-04-2003
Cogito wrote:

> 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.

URI?

--
David Dorward http://dorward.me.uk/
 
Reply With Quote
 
Cogito
Guest
Posts: n/a
 
      09-04-2003
>> 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…

>
>URI?


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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to retrieve form field value if form is EncType=multipart/form-dataForm? Li Zhang ASP .Net 4 02-27-2009 01:23 AM
<form>...</form> - how to supress blank space after </form> in IE? rob c Javascript 4 12-30-2005 01:18 PM
vs2005 - Open a child form based on selected record parent form's dgv - how? dbuchanan ASP .Net 2 12-19-2005 10:52 PM
Another basic question: How to call and show one Web Form from another Web Form? Rob R. Ainscough ASP .Net Web Controls 3 06-14-2005 03:56 PM
Struts form question (attaching filled in form) redfame@gmail.com Java 1 02-25-2005 08:05 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57