I know those backslashes are a nightmare, I didn't know that for the code to validate you have to end each html tag like that
<\/...>
otherwise the code doesn't validate....anyway, was my interpretation of your code correct?
I know those backslashes are a nightmare, I didn't know that for the code to validate you have to end each html tag like that
<\/...>
otherwise the code doesn't validate....anyway, was my interpretation of your code correct?
Hi vibhadevit,
thanks for that. I actually solved the issue this way http://www.antobbo.webspace.virginmedia.com/webediting/tables.htm
but I must admin that your solution is far more elegant than mine.
The answer to your question
Why don't you toggle both layout.
is, well, because I am still at the very beginning, and I really don't know much about Javascript and indeed about HTML and CSS. I really don't quite know what I can and cannot do yet, and, more importantly how to implement it, which is why my code might be a bit clunky at times. :(
Now, back to your code, let me try to understand this properly.
You' ve basically created an extra div and called it layout1 (can I ask why did you create another one and not used the "to_change_into_image"), which is visible,. Then another div called layout2 which you hid using
style="display:none;">, correct?
. Then the changeText() function hides the layout1 with
.style.display = 'none';
and show instead layout2 with
.style.display = 'block';
. The other way round in the second function.
thanks for your help :)
Sorry maybe I wasn't really clear in my post. I have now put the info online, so it might be easier.
ON this page http://antobbo.webspace.virginmedia.com/webediting/testing/tables.htm
the second box has two buttons at the bottom, "show borders" and "reset text". Now what I would like to achieve here is to have the first button, when pressed, to change what's in the box and replace it with something else, in this case a jpg. This button works fine, I managed to write the javascript for it. But the second one, I am a bit lost. I would like it, when pressed, to bring back what was on the box before clicking on the "show borders" button, but I am having many problems trying to achieve that, and I was wondering if anybody can give me a hint/suggestion
thanks
Hi peeps,
I am having some difficulty creating a reset button that resets some text to the original status.
Basically I have a div box in a page which shows what it means to use a table for layout in a page - I am doing a web editing site showing good and bad practice.
As default the box displays a table layout (without borders) and at the bottom I wanted to have two buttons: the first "show borders" which basically changes the text in the box to reveal the borders of the tables, and another "reset" that goes back to the default status. The first button works fine, when you click on it, it loads an image in the box showing how the layout would look like if the table had borders, but I am not sure how to reset it to the original status. Here is the code in the <body>
:
...
<p>
<br>Let's now look at a table used for layout:<br><br>
</p>
<div class="box" id="to_change_into_image">
<h1>Table for layout</h1>
<table class="table_for_layout"><!--OUTER TABLE-->
<tr>
<td><td colspan="2"><p><br></p><h2>Web editing - Tables</h2></td>
</tr>
<tr><td>
<table class="inner_table"><!--INNER TABLE SITS IN THE COLUMN OF THE OUTER TABLE-->
<tr>
<td><a href="styles.htm">Styles</a></td>
</tr>
<tr>
<td><a href="documents.htm">Documents</a></td>
</tr>
<tr>
<td><a href="content.htm">Content</a></td>
</tr>
<tr>
<td><a href="links.htm">Links</a></td>
</tr>
<tr>
<td><a href="Images">Images</a></td>
</tr>
<tr>
<td>Pages</td>
</tr>
<tr>
<td><strong>Tables</strong></td>
</tr>
</table><!--INNER TABLE--></td>
<!--SECOND COLUMN OF INNER TABLE TAKES THE TEXT -->
<td colspan="2"><h3>Tables in the page</h3>
<p>Nowadays tables are used only for tabular data and not …
will try that thanks. Do you know what's the cause of that particular error?
About the 2 DVD being wasted, I think they are fine because I used them for something else and I managed to burn them fine, so I presume they haven't been written at all when I had the error...strange!
thanks guys for replying, I have always had dell and I think I will stick to it to be honest because I am really happy with it.
I every now and then use linux but I think I will buy a laptop with WIndows 7, probably this http://www.dell.com/uk/business/p/xps-l702x/pd?sc_err=noocs
thanks
Hi there I was trying to copy an ISO image with Nero but when I insert the cd I want to burn the image to and start the burning process it stops straight after saying "writing short lead out" and then "burn process failed at 8x (11.08kb)".
Could anybody tell me what that means and why it happens please? I used 2 dvds already ad I am not sure whether i can reuse them or I have to bin them.
I have included the log file as well
I have nero version 7 and windows vista
thanks
amministratore
1C82-0000-19E5-MAAX-4006-3722-****
Windows XP 6.0
IA32
WinAspi: -
NT-SPTI used
Nero Version: 7.10.1.0
Internal Version: 7, 10, 1, 0
Recorder: <HL-DT-ST DVDRAM GSA-T50N>Version: RR07 - HA 1 TA 0 - 7.10.1.0
Adapter driver: <IDE> HA 1
Drive buffer : 2048kB
Bus Type : default (0) -> ATAPI, detected: ?
CD-ROM: <HL-DT-ST DVDRAM GSA-T50N >Version: RR07 - HA 1 TA 0 - 7.10.1.0
Adapter driver: <IDE> HA 1
=== Scsi-Device-Map ===
=== CDRom-Device-Map ===
HL-DT-ST DVDRAM GSA-T50N E: CdRom0
=======================
AutoRun : 1
Excluded drive IDs:
WriteBufferSize: 83886080 (0) Byte
BUFE : 0
Physical memory : 2047MB (2097151kB)
Free physical memory: 2027MB (2075932kB)
Memory in use : 33 %
Uncached PFiles: 0x0
Use Inquiry : 1
Global Bus Type: default (0)
Check supported media : Disabled (0)
24.3.2011
===== Disc-Copy over image - 1st step : Copy to image ...
10.57.11 #1 SPTI -1033 File SCSIPassThrough.cpp, Line 179
CdRom0: SCSIStatus(x02) WinError(0) NeroError(-1033)
Sense Key: 0x02 (KEY_NOT_READY)
Sense Code: 0x04
Sense Qual: 0x01
CDB Data: 0x00 00 00 00 00 00 00 00 00 00 00 00
Sense Area: 0x70 00 02 00 00 00 00 0A 00 00 00 00 04 01
10.57.11 #2 SPTI -1033 File SCSIPassThrough.cpp, Line 179
CdRom0: SCSIStatus(x02) WinError(0) NeroError(-1033)
Sense Key: 0x02 (KEY_NOT_READY)
Sense Code: 0x04
Sense Qual: 0x01
CDB Data: 0xAC 00 00 00 00 00 00 00 00 32 03 00
Sense Area: 0x70 00 02 00 00 00 00 0A 00 00 00 00 04 01
Buffer x07ee4c00: Len x328
10.57.11 #3 SPTI -1033 File SCSIPassThrough.cpp, Line 179
CdRom0: SCSIStatus(x02) WinError(0) NeroError(-1033)
Sense Key: 0x02 (KEY_NOT_READY)
Sense Code: 0x04
Sense Qual: 0x01
CDB Data: 0xAC 00 00 00 00 00 00 00 00 64 00 00
Sense Area: 0x70 00 02 00 00 00 00 0A 00 00 00 00 04 01
Buffer x07ee4fc0: Len x648
10.57.12 #4 SPTI -1033 File SCSIPassThrough.cpp, Line 179
CdRom0: SCSIStatus(x02) WinError(0) NeroError(-1033)
Sense Key: 0x02 (KEY_NOT_READY)
Sense Code: 0x04
Sense Qual: 0x01
CDB Data: 0x00 00 00 00 00 00 00 00 00 00 00 00
Sense Area: 0x70 00 02 00 00 00 00 0A 00 00 00 00 04 01
10.57.15 #5 SPTI -1033 File SCSIPassThrough.cpp, Line 179
CdRom0: SCSIStatus(x02) WinError(0) NeroError(-1033)
Sense Key: 0x02 (KEY_NOT_READY)
Sense Code: 0x04
Sense Qual: 0x01
CDB Data: 0x00 00 00 00 00 00 00 00 00 00 00 00
Sense Area: 0x70 00 02 00 00 00 00 0A 00 00 00 00 04 01
10.58.04 #6 Text 0 File SCSIPTICommands.cpp, Line 424
LockMCN - completed sucessfully for IOCTL_STORAGE_MCN_CONTROL
10.58.04 #7 Text 0 File SCSIPTICommands.cpp, Line 215
SPTILockVolume - completed successfully for FSCTL_LOCK_VOLUME
10.58.04 #8 Text 0 File DVDCopy.cpp, Line 320
DVD Track-Information from source disc:
Media Type: DVD-R
S01 T01 Con 0x14 Start 0 Len 513216 NWA -1 (gap 0) Blank 0 Res 0 Dmg 0 Open Trk 0 Mode TRM_DATA_MODE1 (0)
10.58.04 #9 Text 0 File DVDCopy.cpp, Line 435
Max -1 tracks of 1 allowed to copy
1: 0 - 513216 = 513216, TRM_DATA_MODE1, block size 2048, read opt 0 (no read options)
10.58.04 #10 Text 0 File Burncd.cpp, Line 3508
Turn on Disc-At-Once, using DVD media
10.58.04 #11 Text 0 File DlgWaitCD.cpp, Line 307
Last possible write address on media: 4718591 (1048:34.41, 9215MB)
Last address to be written: 513215 (114:02.65, 1002MB)
10.58.04 #12 Text 0 File DlgWaitCD.cpp, Line 319
Write in overburning mode: NO (enabled: CD)
10.58.04 #13 Text 0 File DlgWaitCD.cpp, Line 493
>>> Protocol of DlgWaitCD activities: <<<
=========================================
10.58.04 #14 Text 0 File ThreadedTransferInterface.cpp, Line 793
Setup items (after recorder preparation)
0: TRM_DATA_MODE1 (1 - Data (mode 1))
2 indices, index0 (150) not provided
original disc pos #0 + 513216 (513216) = #513216/114:2.66
not relocatable, disc pos for caching/writing not required/not required
-> TRM_DATA_MODE1, 2048, config 0, wanted index0 0 blocks, length 513216 blocks [Image Recorder]
--------------------------------------------------------------
10.58.04 #15 Text 0 File ThreadedTransferInterface.cpp, Line 995
Prepare [Image Recorder] for write in CUE-sheet-DAO
DAO infos:
==========
MCN: ""
TOCType: 0x40; Session Closed, disc not fixated
Tracks 1 to 1: Idx 0 Idx 1 Next Trk
1: TRM_DATA_MODE1, 2048/0x00, FilePos 0 0 1051066368, ISRC ""
DAO layout:
===========
___Start_|____Track_|_Idx_|_CtrlAdr_|_____Size_|______NWA_|_RecDep__________
0 | lead-in | 0 | 0x41 | 0 | 0 | 0x00
0 | 1 | 0 | 0x41 | 0 | 0 | 0x00
0 | 1 | 1 | 0x41 | 513216 | 513216 | 0x00
513216 | lead-out | 1 | 0x41 | 0 | 0 | 0x00
10.58.04 #16 Text 0 File Burncd.cpp, Line 4294
Caching options: cache CDRom or Network-No, small files-No (<64KB)
10.58.04 #17 Phase 120 File dlgbrnst.cpp, Line 1762
Creating the image for burning
10.58.04 #18 Text 0 File ThreadedTransferInterface.cpp, Line 2721
Verifying disc position of item 0 (not relocatable, no disc pos, no patch infos, orig at #0): write at #0
10.58.04 #19 Text 0 File ThreadedTransfer.cpp, Line 269
Pipe memory size 590400
11.01.07 #20 Text 0 File WriterStatus.cpp, Line 113
<Image Recorder> start writing Lead-Out at LBA 513216 (7D4C0h), length 0 blocks
11.01.08 #21 Phase 121 File dlgbrnst.cpp, Line 1762
Creating Image completed successfully
11.01.09 #22 Text 0 File SCSIPTICommands.cpp, Line 261
SPTIDismountVolume - completed successfully for FSCTL_DISMOUNT_VOLUME
11.01.12 #23 Text 0 File SCSIPTICommands.cpp, Line 424
UnLockMCN - completed sucessfully for IOCTL_STORAGE_MCN_CONTROL
11.01.12 #24 Text 0 File Cdrdrv.cpp, Line 11185
DriveLocker: UnLockVolume completed
===== Disc-Copy over image - 2nd step : Burn the image ...
11.01.12 #1 Text 0 File SCSIPTICommands.cpp, Line 424
LockMCN - completed sucessfully for IOCTL_STORAGE_MCN_CONTROL
11.01.12 #2 IMAGEGEN -10 File ImageGen.cpp, Line 366
Image was written as DAO.
DAOI:
MediaCatalogNumber = ''
TocType = 0x40
Finalized = 0
First/Last Track = 1 / 1
1: ISRC = ''
Blocksize = 2048
TrackMode = 'TRM_DATA_MODE1'
TrackConfig = 0x00
First/Last Index = 0 / 1
Index0FilePos = 0, Index1FilePos = 0, NextTrackFilePos = 1051066368
CUES:
MTYP: Mediumtype = DVD (old format) (0x1C)
Image file name: <C:\Users\amministratore\Documents\TempImage.nrg>
11.01.12 #3 Text 0 File Burncd.cpp, Line 3508
Turn on Disc-At-Once, using DVD media
11.01.54 #4 Text 0 File DlgWaitCD.cpp, Line 307
Last possible write address on media: 2298495 (510:46.45, 4489MB)
Last address to be written: 513215 (114:02.65, 1002MB)
11.01.54 #5 Text 0 File DlgWaitCD.cpp, Line 319
Write in overburning mode: NO (enabled: CD)
11.01.54 #6 Text 0 File DlgWaitCD.cpp, Line 2972
Recorder: HL-DT-ST DVDRAM GSA-T50N, Media type: DVD-R
Disc Manufacturer: MCC 03 - RG20
Disc Application Code: 64, Disc Physical Code: 193
11.01.54 #7 Text 0 File DlgWaitCD.cpp, Line 493
>>> Protocol of DlgWaitCD activities: <<<
=========================================
Insert empty disc to write to.
(Medium in drive: Unknown. Medium required by compilation: DVD R/RW; DVD R DL; DVD-RAM.)
11.01.54 #8 Text 0 File ThreadedTransferInterface.cpp, Line 793
Setup items (after recorder preparation)
0: TRM_DATA_MODE1 (1 - DVD-ROM)
2 indices, index0 (150) not provided
original disc pos #0 + 513216 (513216) = #513216/114:2.66
not relocatable, disc pos for caching/writing not required/not required
-> TRM_DATA_MODE1, 2048, config 0, wanted index0 0 blocks, length 513216 blocks [E: HL-DT-ST DVDRAM GSA-T50N]
--------------------------------------------------------------
11.01.54 #9 Text 0 File ThreadedTransferInterface.cpp, Line 995
Prepare [E: HL-DT-ST DVDRAM GSA-T50N] for write in CUE-sheet-DAO
DAO infos:
==========
MCN: ""
TOCType: 0x40; Session Closed, disc not fixated
Tracks 1 to 1: Idx 0 Idx 1 Next Trk
1: TRM_DATA_MODE1, 2048/0x00, FilePos 0 0 1051066368, ISRC ""
DAO layout:
===========
___Start_|____Track_|_Idx_|_CtrlAdr_|_____Size_|______NWA_|_RecDep__________
0 | lead-in | 0 | 0x41 | 0 | 0 | 0x00
0 | 1 | 0 | 0x41 | 0 | 0 | 0x00
0 | 1 | 1 | 0x41 | 513216 | 0 | 0x00
513216 | lead-out | 1 | 0x41 | 0 | 0 | 0x00
11.01.54 #10 Text 0 File SCSIPTICommands.cpp, Line 215
SPTILockVolume - completed successfully for FSCTL_LOCK_VOLUME
11.01.54 #11 Text 0 File Burncd.cpp, Line 4294
Caching options: cache CDRom or Network-No, small files-No (<64KB)
11.01.54 #12 Phase 36 File dlgbrnst.cpp, Line 1762
Burn process started at 8x (11.080 KB/s)
11.01.54 #13 Text 0 File ThreadedTransferInterface.cpp, Line 2721
Verifying disc position of item 0 (not relocatable, no disc pos, no patch infos, orig at #0): write at #0
11.01.54 #14 Text 0 File DVDR.cpp, Line 3225
Recording mode: Sequential Recording Mode for Multisession
11.01.54 #15 Text 0 File DVDR.cpp, Line 3381
Start write address at LBA 0
DVD high compatibility mode: Yes
11.01.54 #16 Text 0 File Cdrdrv.cpp, Line 9872
---- Disc Structure: Physical Format Information (00h) ----
Media Type: 0, Layer: 0, Address: 0 (0 h), AGID: 0; Length: 2050
Book Type: DVD-R (2), Part Version: 2.0x (5), Extended Part Version: 2.1 (33)
Disc Size: 120 mm, Maximum Rate: <not specified> (F h)
Number of Layers: 1, Track Path: Parallel Track Path (PTP), Layer Type: recordable
Linear Density: 0,267 um/bit, Track Density: 0,74 um/track
Starting Physical Sector Num
Hi there,
I am thinking about buying a new laptop and I was wondering whether anybody has any suggestions.
Basically I do a bit of programming (learnimg C++ at the moment, so nothing advanced just console programs) and I am now getting into building websites so I always end up having an awful lot of stuff running on my laptop with the result that it is really really slow.
At the moment I have a laptop - dell inspiron 1300 2gb ram (which I use all the time for the above jobs) - and a netbook - samsung n10 which I sometimes use it to do all my work, including programming and web editing.
Now, in view of this I wonder what type of laptop you recommend. Clearly 2GB of mem are not enough because my machines always struggle a bit so I was looking at the dell XPS 17 http://www1.euro.dell.com/uk/en/home/Dell-Laptops/xps-17/pd.aspx?refid=xps-17&s=dhs&cs=ukdhs1&~ck=mn
the one with i7-2630QM processor. It could be a good investment especially for the future considering that I will hopefully get better at programming and developing. It comes with 4gb ram, but I am not sure if you can go up or not.
I ws also looking at one of these http://www.gd-itronix.com/index.cfm?page=Products:GD6000 but it doesn't seem to be as powerful as the dell.
Is there any other product that you guys suggest?
thanks
caut_baia thanks for posting the code. I had a look at that but there are things that I haven't encountered as yet, like the :
operator (what is it?), destructors (I believe the tilde ~ signify the presence of a destructor) and virtual functions, so I am slightly hesitant to base my program on that particular code.
I am sure there are probably dozen different ways to solve this problem and I am sure that my code might not be the best in terms of performance but I think I should stick more to the way the exercise is asking me to do things. Having said that I am absolutely happy to improve the code when it gets to the point that it become unusable if that's the case for mine, but, as I said, I would like to use the suggestions that the outline of the exercise is giving.
Is there any way that I can improve my code (as in could you help me to identify what's wrong with it...it doesn't seem to work for whatever reason...)
thanks
Hi there,
thanks I see what you mean. I think I will go on then and see what happens, I suppose it can't be worse than windows vista anyway. Is there a quick way to determine which manufacturer has the same camera as that laptop?
If we encounter some problem I suppose I can always post in here and try to find a solution : - ). I read on the dell website that if you are unable to find the drivers usually the ones for vista should work fine
thanks
Hi there,
I am trying to do an exercise from a C++ book. It goes:
Develop a program that will move the knight around an empty chessboard. The chessboard is represented by an 8-by-8 two-dimensional array board[][]
. Each of the squares is initialized to 0. We describe each of the 8 possible moves in terms of both thir horizontal and vertical components. For example, a move of type 0, as shown in the attachment, consists of moving 2 squares horizontally to the right and one square vertically upward. Move 2 consists of moving 1 square horizontally to the left and 2 squares vertically upward. Horizontal moves to the left and vertical moves upward are indicated with negative numbers. The 8 moves may be described by 2 one-dimensional arrays horizontal[]
and vertical[]
as follow:
horizontal[0] = 2
horizontal[1] = 1
horizontal[2] = -1
horizontal[3] = -2
horizontal[4] = -2
horizontal[5] = -1
horizontal[6] = 1
horizontal[7] = 2
vertical[0] = -1
vertical[1] = -2
vertical[2] = -2
vertical[3] = -1
vertical[4] = 1
vertical[5] = 2
vertical[6] = 2
vertical[7] = 1
Let the variable currentRow
and currentColumn
indicate the row and column of the knight's current position. TO make a move of type moveNumber
where moveNumber
is between 0 and 7 your program uses the statements
currentRow += vertical[ moveNumber ] ;
currentColumn += horizontal[ moveNumber ] ;
Keep a counter that varies from 1 to 64. Record the latest count in each square …
hi there,
thanks for your replies. I had a look at the Dell website under windows7 compatibility as Rik from RCE suggested but,strangely, her laptop model is not there...! however, when I downloaded on her machine the WIndows7 upgrade advisor from the Microsoft website, it says it is generally fine (I attached the report)
thanks
Hi guys,
I need some advice please.
My gf wants to buy and install WIndows7 on her machine (a Dell studio 1535). Now, it has windows vista on it, so I was wondering whether there could be any issue with replacing it with WIndows7. Unfortunately it is not my own laptop so I don't feel too good to mess around with it before knowing that it is fine.
If it is ok to do that, what would be the procedure? the usual one, get hold of windows7, install it (will probably format the HD anyway) and that's it, or is there anything in particular I should watch out for?
thanks
@Taywin
no need to be sorry that's fine, I just wanted to understand the code : -). I suppose I can leave it as it is because it is working now and it is validating the code too. Thanks for all your help, much appreciated
@SolidSolutions
I know it's been a long thread! I think it is all sorted now, the box on http://www.antobbo.webspace.virginmedia.com/webediting/documents.htm works the way it should so I will copy the code over the rest of the pages (that's basically what we've tried to do in this thread : -) )
Thanks for all your help too, much appreciated
thank you burgercho that worked well and it validates too (which I think is a bit odd, I would have thought it won't validate it because we're taking the control away from the user).
I also moved the <title>
within the <head>
as per DOCTYPE.
So the same thing is not achievable using solely PHP? I mean isn't there any code that allows you to redirect a user back to a page (providing that it shows you the submission page of course)?
@SolidSolution
apologies I think I misread your reply. I tried your suggestion and it works well, the "comment" button is now gone, thanks for your help, here's the link http://www.antobbo.webspace.virginmedia.com/webediting/documents.htm
@Taywin
as promised I created a test site, so I can work on that http://www.antobbo.webspace.virginmedia.com/webediting/testing/documents.htm
What I was trying to say in my last post was that I applied the suggestions you gave me but in the java script if I do
...
<script type="text/javascript">
<!--
function showCommentBox(buttonObject)
{
var feedback_box = document.getElementById('comment');
feedback_box.className = "";
buttonObject.className = "hidden" // now hide the button
}
...
then the box doesn't pick up the comment_box
style anymore (compare the comment box in the test site and in the real one.) Even if I add an explicit call like
feedback_box.className = "comment_box";
it doesn't work, so I was wondering what
feedback_box.className = "";
does: why do we have empty quotes?
thanks
@Taywin
Thanks yes it is a bit clearer thanks. Yes the website mentioned http://www.antobbo.webspace.virginmedia.com/webediting/documents.htm is the one I am working on. At the moment, the "documents" page - I mean the live one - is working fine (and it has the window.scrollBy()
function in it) but what I am testing (the CSS and Java script code for the "documents" page - the one that's not online and which I posted in this thread) as said it is being a bit funny. The idea is to get the test page right and then copy the code over onto the live website
If easier I can set up a test area and set it live rather than copying and pasting code which might be confusing, sorry for that. That done, I will post the link here with the issues I am experiencing after applying the suggestions in
Correct. You have the 'display:none' property in your style. An element will be effected by all properties in classes you add.
I will do that after work.
Thanks for your help
@SolidSolution
The code on the http://www.antobbo.webspace.virginmedia.com/webediting/headings.htm page is different because I was thinking to get the code right for the http://www.antobbo.webspace.virginmedia.com/webediting/documents.htm page first and then paste it into the rest of the website
Thanks that works but I have few questions:
-I am not quite sure what the DOM object is, and I can't see the "this" object declared anywhere. Is "this" a kind of keyword or something special? From what I see you pass "this" to the function showCommentBox()
which then uses it to hide the button. SO does somehow "this" stand for the button? How?
-Don't quite understand this line:
feedback_box.className = "";
What does it do? I thought I had to specify the classes to be called, so something like
feedback_box.className='comment_box'
which picks up the style of the box like in here http://www.antobbo.webspace.virginmedia.com/webediting/headings.htm. At the moment if I have it your way the box doesn't pick up the style in the style sheet (which was done with
feedback_box.className='comment_box'
, but if I add that line back it doesn't work). Also the
window.scrollBy(0,150)
doesn't work anymore. Here's the new Java script:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Web editing - Documents</title>
<link rel="stylesheet" type="text/css" href="style.css" >
<!--BEGINNING JAVA SCRIPT -->
<script type="text/javascript">
<!--
function showCommentBox(buttonObject)
{
var feedback_box = document.getElementById('comment');
feedback_box.className = "";
buttonObject.className = "hidden" // now hide the button
window.scrollBy(0,150)
}
function validation(field,message)
{
if(field.value.length==0)
{
alert(message);
field.focus();
return false;
}
return true;
}
//-->
</script>
<!-- END JAVA SCRIPT-->
and <forms>
<form action="email.php" method="post" onsubmit="return validation(document.getElementById('commentsid'),'Enter a value')">
<div class="hidden" id="comment">
<p>Comments and suggestions:<br><textarea name="comments" id="commentsid" rows="3" cols="30"></textarea><br><br>
<input type="submit" value="Send"></p>
</div> …
thanks guys.
Do you want the 'feedback_box' to use all 3 classes in CSS? If so, do as followed
Taywin, I thought I wanted to do that, (and thanks for the tip I didn't know I had to have them all in the same call) but I noticed that if I do that the "Comment" button doesn't show up in the first place...sorry I am getting lost doing what should probably be quite easy. Is it because I have to call .comment_button
not at the same time as the other classes?
At the moment I have (it is not live on the website thought, still testing) in my CSS:
...
/*hiding the comment box*/
.comment_button /* In my previous version I think I had p.comment_button, sorry*/
{
display:none;
...
}
and this is the <form>
<form action="email.php" method="post" onsubmit="return validation(document.getElementById('commentsid'),'Enter a value')">
<div class="hidden" id="comment">
<p>Comments and suggestions:<br><textarea name="comments" id="commentsid" rows="3" cols="30"></textarea><br><br>
<input type="submit" value="Send"></p>
</div> <!-- end of comment_box-->
<p><input type="button" value="Comment" class="comment_button" onclick="showCommentBox()"><br></p>
</form>
If I want the "Comment" button to disappear when the comment box appears I thought that I had to call that class at the same time as the other ones but that doesn't sem to be the case. Does it mean that it needs to be called after?
SolidSolutions, I have used the function you suggested window.scrollBy()
and it works fine thanks, but I have a question on that. On this page http://www.antobbo.webspace.virginmedia.com/webediting/documents.htm I used window.scrollBy(0,150)
but …
Ah ok, sorry didn't know that was possible I thought everything had to be within the same angle brackets.
I tried what you suggested burgercho but something really funny happen. If I keep my script as it was
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<title>Thank you</title>
<body>
<?php
$to = "antobbo@gmail.com";
$subject = "Comments on page";
$message = $_POST["comments"];
mail($to,$subject,$message);
echo "<p>Thank you for sending your feedback. That will help me improve the website.</p>";
?>
</body>
</html>
the comment gets sent to my email address, if I change to the above, I receive no comment at all, I have just tested...not sure why that is.
One more thing I forgot to mention was that I would like people to see the thank you page, and then get redirected back to the source page, but with the script you suggested when I submit the form I can't see the thank you page at all
thanks
Sorry I meant how to move the button down, not the comment box itself. I had a look at the window.scrollTo
function (couldn't find anywhere any reference to window.scrollBy
)but I seem to understand that it is just to set the focus to an element of the page at the coordinates specified, whereas the issue with the button might be more to do with CSS, is that correct?
Good point about hiding the comment button though, I will see if I can achieve that creating a new "hidden" class and call it from the script, which turned out to be not that easy.
I basically created another class in my CSS:
/*hiding the comment box*/
p.comment_button
{
display:none;
}
to hide the button and now my <form>
looks like this:
<form action="email.php" method="post" onsubmit="return validation(document.getElementById('commentsid'),'Enter a value')">
<div class="hidden" id="comment">
<p>Comments and suggestions:<br><textarea name="comments" id="commentsid" rows="3" cols="30"></textarea><br><br>
<input type="submit" value="Send"></p>
</div> <!-- end of comment_box-->
<p><input type="button" value="Comment" class="comment_button" onclick="showCommentBox()"><br></p>
</form>
I modified the javascript to be
<script type="text/javascript">
<!--
function showCommentBox()
{
var feedback_box = document.getElementById('comment');
feedback_box.className='visible' ;
feedback_box.className='comment_box';
feedback_box.className='comment_button';
}
function validation(field,message)
{
if(field.value.length==0)
{
alert(message);
field.focus();
return false;
}
return true;
}
//-->
</script>
Have I done anything wrong?
Ok thanks for that, but I can see some problems here.
If I have the php file like
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<?php
header('Location: http://www.antobbo.webspace.virginmedia.com/webediting/documents.htm');
$to = "antobbo@gmail.com";
$subject = "Comments on page";
$message = $_POST["comments"];
mail($to,$subject,$message);
echo "<p>Thank you for sending your feedback. That will help me improve the website.</p>";
?>
<html>
<title>Thank you</title>
<body>
</body>
</html>
with the header before any output hte html code won't validate and the script also (when it loads the php page) returns an error that reads:
"Warning: Cannot modify header information - headers already sent by (output started at /tier-11/pwpstore3/1/antobbo/htdocs/webediting/email.php:4) in /tier-11/pwpstore3/1/antobbo/htdocs/webediting/email.php on line 5
Thank you for sending your feedback. That will help me improve the website."
I then cannot have this I suppose because the header needs to appear before any output:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<title>Thank you</title>
<?php
header('Location: http://www.antobbo.webspace.virginmedia.com/webediting/documents.htm');
$to = "antobbo@gmail.com";
$subject = "Comments on page";
$message = $_POST["comments"];
mail($to,$subject,$message);
echo "<p>Thank you for sending your feedback. That will help me improve the website.</p>";
?>
<body>
</body>
</html>
This validates...so I wonder, can I have something like:
<?php
header('Location: http://www.antobbo.webspace.virginmedia.com/webediting/documents.htm');
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<title>Thank you</title>
$to = "antobbo@gmail.com";
$subject = "Comments on page";
$message = $_POST["comments"];
mail($to,$subject,$message);
echo "<p>Thank you for sending your feedback. That will help me improve the website.</p>";
?>
<body>
</body>
</html>
or is it considered …
Sorry I don't mean to sound silly but in
header("Location: $HTTP_REFERER");
do I need to replace "location" with the URL I want people to go back to?
Also you said it goes before any HTML, so does it go also before the doctype? SOrry but I couldn't find anything about this...
yoge911 thanks for posting the code but I think for now I will stick to java script and a bit of PHP, not ready for Ajax and jquery yet :)
Thanks guys I have updated the script and now it works. http://www.antobbo.webspace.virginmedia.com/webediting/documents.htm
SolidSolutions good point about the button, I managed to move it but unfortunately when the box appears the button slides next to it...
I tried to clear:both;
in the CSS but it doesn't work..not sure how to move that box down, or is it a question more for the HTML forum?
thanks
Hi there, I have added a validation script to this page http://antobbo.webspace.virginmedia.com/webediting/documents.htm but it is not working the way I want it to, I am sure I made some silly mistake.
Basically I want to make sure that people actually input something in the form below before submitting it. If they attempt to submit it blank they get a pop up window saying that they should type something inside but unfortunately after clicking ok on the box the form gets submitted (goes to a php page with the thank you message).
Now, when the pop up window with the alert message comes up I would like to be able to click OK and prevented from submitting the form till I type something in.
The full script I have is this:
<!--BEGINNING JAVA SCRIPT -->
<script type="text/javascript">
<!--
function showCommentBox()
{
var feedback_box = document.getElementById('comment');
feedback_box.className='visible' ;
feedback_box.className='comment_box';
}
function validation(field,message)
{
if(field.value.length==0)
{
alert(message);
field.focus();
return false;
}
return true;
}
//-->
</script>
<!-- END JAVA SCRIPT-->
and this is the html element:
<form action="email.php" method="post" onsubmit="validation(document.getElementById('commentsid'),'Enter a value')">
<p><input type="button" value="Comment" onclick="showCommentBox()"><br></p>
<div class="hidden" id="comment">
<p>Comments and suggestions:<br><textarea name="comments" id="commentsid" rows="3" cols="30"></textarea><br><br>
<input type="submit" value="Send"></p>
</div> <!-- end of comment_box-->
</form>
Is it because the function validation()
is trying to pass the id="commentsid"
before it is declared? If so, can I move the function call to validation()
where the Send button in so that it reads:
<form action="email.php" method="post" >
<p><input …
Hi there,
today I have written my first PHP script (and it even works, how cool!) and I have few questions.
Here's the script
<?php
$to = "myemail@myemail.com";
$subject = "Comments on page";
$message = $_POST["comments"];
mail($to,$subject,$message);
echo "Thank you for sending your feedback. That will help me improve the website.";
?>
and this is the element it applies to (I am testing it onto this page http://antobbo.webspace.virginmedia.com/webediting/documents.htm)
<form action="email.php" method="post">
<p><input type="button" value="Comment" onclick="showCommentBox()"><br></p>
<div class="hidden" id="comment">
<p>Comments and suggestions:<br><textarea name="comments" rows="3" cols="30"></textarea><br><br>
<input type="submit" value="Send"></p>
</div> <!-- end of comment_box-->
</form>
Now, the action page is email.php which then displays a message upon form submission (I still need to style this page a bit so it has just a simple message at the moment) and I kind of wondered how I can after say 5-10 seconds redirect people back to my website automatically rather than leaving them on the php page. Do I need to do that in PHP or can I do that in Java script? And where would I place this new script (or should be part on another script?!)...sorry I hope I am making some sense!
thanks
Brilliant, thanks a lot, I will have a go, sure will be posting here again soon : - )
PHP is not too difficult depending on your programming experience...
I am actually studying C++, so I know the basics.
I will try with the .php test file even if I think it should be ok, Virgin is hosting my website I assume their servers are ok with PHP.
I will then have a look at your link and try to make the script and then see how it goes. So just to be sure, the PHP script is all I need to make my comment box idea work, no need for anything else?
Hi there,
I have developed (with some invaluable and greatly appreciated help!) a comment box using Java script (see bottom of this page http://www.antobbo.webspace.virginmedia.com/webediting/documents.htm) but I would like now to be able to receive comments via email. At the moment if you click on the comment button it opens the comment box (which is great) but if you type something and click "send" it opens outlook and try to send an email to the specified address. Upon clicking "Send" I would like the comment to be sent automatically to the email address specified.
Now, I have done some research and looked around a bit and from what I gathered I need to have a PHP script that handles the comment and a database where the comment gets kept to be then called by the script and dealt with..or something like that. Granted that I have no experience in either Java script (this is the first script I ever done) or in PHP (never done anything) I wonder if you have any other suggestion on how to achieve the above.
Is there, say, any library that I could use so that the comment input by the users gets somehow automatically handled or do I have to write the PHP script myself?
Also I read that a lot depends on the internet provider as well, in so much so that if their server do not support PHP then I have to find another way.
So, …
ok thanks that's clear
this is roughly what I meant (I know the code is wrong because it doesn't work but still might clarify a bit )
<html>
<head>
<style type="text/css">
.comment_box
{
border-style:solid;
border-width:1px;
float:left;
background-color:#d4d4cb;
width:280px;
padding-left:20px;
padding-top:25px;
padding-bottom:10px;
}
</style>
<script type="text/javascript">
<!--
function popup(box) {
comment= confirm("Do you want to leave a comment?")
if(comment)
{
document.write("comment_box")
}
else
{
document.write("You cancelled")
}
}
//-->
</script>
</head>
<body>
<input type="button" value="Comment" onclick="popup('comment_box')"><br />
<div class="comment_box">
<form action="mailto:myemail@domain.com" method="post">
<p>Comments and suggestions:<br><textarea name="comments" rows="3" cols="30"></textarea><br><br>
<input type="submit" value="Send"></p>
</form>
</div> <!-- end of comment_box-->
</body>
</html>
I don't really want the user to get a pop up confirmation window before he/she leaves a comment but the
confirm()
method was the only one I found that coould somehow help me
Hi there,
I am totally new to Java script (just began to looking into it) and I would like to do something with the comment box on one of the website I am working on http://antobbo.webspace.virginmedia.com/webediting/documents.htm
Basically rather than that box at the bottom of the page I was thinking to have a link saying something like "comment" and if I click on it the text box appears.
Now, this is my html comment box code:
<div class="comment_box">
<form action="mailto:myemail@domain.com" method="post">
<p>Comments and suggestions:<br><textarea name="comments" rows="3" cols="30"></textarea><br><br>
<input type="submit" value="Send"></p>
</form>
</div> <!-- end of comment_box-->
CSS
.comment_box
{
border-style:solid;
border-width:1px;
float:left;
background-color:#d4d4cb;
width:280px;
padding-left:20px;
padding-top:25px;
padding-bottom:10px;
}
and for the script I am not quite sure how to proceed. I suppose the box will need to be shown using a
document.write()
method but does it mean that I have to copy the content of my
<form></form>
into the script? So something like "if I click on the comment button show the box"?
this is what I came up so far, it is not much sorry
<script type="text/javascript">
<!--
function popup() {
document.write() /* not quite sure what to put in it*/
}
//-->
</script>
<body>
</body>
<input type="button" value="Comment" onclick="popup()"><br />
ANy help/suggestion greatly appreciated
thanks
ok great thanks
Oh silly me, sorry that was a really stupid mistake to do...and I read the code many times without spotting it...
Thanks for that. Can I then ask, you said it makes an "educated guess", so what does exactly happen if I leave out the semicolon, I mean what kind of interpretation is the compiler trying to give to the program (if it is not too difficult to understand : - ))?
Hi there,
I am doing an exercise from a c++ book, but I get few errors that I can't seem to be able to fix, and I am not quite sure why.
The exercise goes:" In a right triangle with dimensions side1, side2 and hypotenuse, find all Pythagorean triples for side1, side2 and hypotenuse no larger than 500...".
Now these are the errors I am getting in Visual C++:
Compiling...
triangle.cpp
c:\program files\microsoft visual studio 8\vc\include\sal.h(226) : error C2143: syntax error : missing ';' before 'string'
c:\program files\microsoft visual studio 8\vc\include\sal.h(226) : error C2059: syntax error : 'string'
c:\program files\microsoft visual studio 8\vc\include\sal.h(226) : error C2143: syntax error : missing ';' before '{'
c:\program files\microsoft visual studio 8\vc\include\sal.h(226) : error C2447: '{' : missing function header (old-style formal list?)
triangle_main.cpp
z:\in common folder 24_09\programming\exercises deitel and deitel\ex 5.20 p242\triangle_main.cpp(7) : error C2628: 'Triangle' followed by 'int' is illegal (did you forget a ';'?)
z:\in common folder 24_09\programming\exercises deitel and deitel\ex 5.20 p242\triangle_main.cpp(9) : error C3874: return type of 'main' should be 'int' instead of 'Triangle'
z:\in common folder 24_09\programming\exercises deitel and deitel\ex 5.20 p242\triangle_main.cpp(14) : error C2664: 'Triangle::Triangle(const Triangle &)' : cannot convert parameter 1 from 'int' to 'const Triangle &'
Reason: cannot convert from 'int' to 'const Triangle'
No constructor could take the source type, or constructor overload resolution was ambiguous
Generating Code...
Build log was saved at "file://z:\In common folder 24_09\programming\deitel …
Teedoff, thanks that's a really good example, now it is a bit clearer. So basically, what I need to do is to create a div (div1) that contains my navigation (div2) and text (div3). If div1 is 900px wide, div2's and div3's width must be contained within div1's width. If it is bigger, problems start happen.
Div1 (in your case wrapper) has got
margin: 0 auto;
which basically centers the box. Div2 (navigation) is floating left. I would have thought that div3 (mainContent)to slot in properly had to be floating right...
Also one more thing: in your code you said
#mainContent h2 { margin: 0 auto; }
Now, I would have thought that the h2 would have been centered in respect of the mainCOntent div and not in respect of wrapper div. How's that?
About many bits of my code being unnecessary, well yes, I think that's because I have been keeping adding things to the CSS so there are things that probably shouldn't be there, I will try to tidy this up, thanks
Hi there thanks, I tried that but it doesn't seem to work. here's what I have:
page:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Web editing - Our web standards</title>
<link rel="stylesheet" type="text/css" href="style.css" >
</head>
<body>
<!-- BANNER STARTS HERE -->
<div id="banner">
<h1>Web editing</h1>
</div>
<!-- BANNER ENDS HERE -->
<!-- TOP NAVIGATION STARTS HERE -->
<div id="topnav">
<ul>
<li><a href="home.htm">Home</a></li>
<li><strong>Our web standards</strong></li>
<li>Livelink issues and fixes</li>
<li>How to's</li>
<li>Do's and don'ts</li>
<li>Reference</li>
</ul>
</div>
<div id="horizontal_line">
<hr>
</div>
<!-- TOP NAVIGATION ENDS HERE -->
<!-- LEFT HAND SIDE NAVIGATION STARTS HERE -->
<div id="navigation">
<ul>
<li><a href="headings.htm">Headings</a></li>
<li>Documents</li>
<li>Content</li>
<li>Links</li>
<li>Images</li>
</ul>
</div>
<!-- LEFT HAND SIDE NAVIGATION ENDS HERE -->
<!-- MAIN CONTENT STARTS HERE -->
<div class ="heading_paragraph_navigation">
<h2>Web standards</h2>
</div>
<div style="float:left;width:650px" class="text_navigation">
<p> The Web Standards are really what help us to make sure that the information on our website is usable, consistent and up to date.<br><br>
Our editors periodically check the website for error and inconsistency and when they find some problem (depending on the type of the problem) will usually get in touch with the relevant departmenr and discuss the matter.<br><br>
Common errors that we come across quite often concern headings, text, documents, images and links.
</p>
</div>
<!-- MAIN CONTENT ENDS HERE -->
</body>
</html>
CSS:
*
{
margin:0;
padding:0;
}
h1
{
text-align:left;
font-size: 1.7em;
font-family: Arial, Verdana, sans-serif;
}
#banner
{
background:#81A594 url(typewriter.jpg);
background-repeat:no-repeat;
background-position:right;
height:120px;
padding:10px 50px 0 200px; …
Hi ya, me again.
I have done some more work on my website http://www.antobbo.webspace.virginmedia.com/webediting/our_web_standards.htm but I am having an issue with the content being pushed down by the navigation.
Now, I read few tutorials on float but I don't seem to be able to find the answer there. I presume it is a float issue so I have tried few more things like trying to float the text to the right, but sill same result, the text stays below the navigation, and in all the browsers. I am not quite sure what I am missing here, any hint please?
thanks
hi there,
thanks for your comments.
Perhaps the most important problem is that what your program actually does is different from what you said you were asked to do...[
I thought to print and test the number while I was inputting them and I didn't really attempt any validation. Sorry but I am still at the beginning, so try to get to grips with things :)
WaltP, thanks I will bear in mind the function and class issues.
Hi there,
I have done a small exercise (ex 4.17 on C++ how to program - deitel and deitel) which basically is about writing a program that uses a while statement to determine and print the largest number of 10 numbers input by the user. The program should use 3 variables, counter, number and largest.
So, here is the program:
header file:
//exercise_4-17.h file, holding the class definition
class LargestNumber
{
public:
void processNumbers( ) ; //processes the numbers
};
cpp file:
//exercise_4-17.cpp file, holding the functions definitions
#include <iostream>
using namespace std ;
#include "exercise_4-17.h"
void LargestNumber::processNumbers( )
{
int counter = 1 ;
int largest = 0 ;
int number ;
while( counter <= 10 )
{
cout << "Insert number: " ;
cin >> number ;
if( number > largest )
{
largest = number ;
cout << "The largest number so far is: " << largest << endl ;
}
else
{
cout << "The largest number so far is: " << largest << endl ;
}
counter++ ;
}
}
and main file:
//exercise_4-17_main.cpp holds the main file
#include "exercise_4-17.h"
int main( )
{
LargestNumber numbers; //create LargestNumber object
numbers.processNumbers();
return 0;
}
Now, this exercise was rather easy, so I was wondering whether it would be good practice to like use private members in the class: say, I could declare the variable in the class and make them private and then access them via a getter and change …
Excellent, thanks!
Oh I see, thanks. I read what you suggested about CSS by the way, it was interesting and useful to know more about floating, thanks. Do you happen to have anything good about DIVs? I am using the W3C schools website a lot, but really, it doesn't explain things, and I often need some more explanation and details...
I will post more stuff about my website quite soon, still have some funny problems but thanks for your help so far
Ok the good news is that I kind of fixed it, the bad one is that I don't know why the change I made fixed it.
I simply put the
<hr>
in a
<div>
(and I think somebody mentioned something like that in this thread) and it works as in the line is now floating left in IE7 as well (yay!!) even if it creates a strange effect on the line itself which looks like it has a secondary smaller line running across the whole width... anyway, why would a
<div>
fix it? It is just a container!
What I have done I have replaced
<hr id="horizonal_line">
with
<div id="horizontal_line">
<hr>
</div>
This makes no sense at all to me...
Ok then, I am happy to have a line that covers the entire width of the page if there is nothing we could do to fix it.
How do I proceed to achieve that? I suppose I can't simply remove
width:46.8em;
float:left;
all sorts of things happen like spacing between the line and the navigation goes crazy in IE7 and disappears completely in Firefox...
you need to determine height for that div
which div, the hr is not in a div.
Try removing the width and float...
Done, and yes the line is covering the whole page now and seems to be the same for IE7 and Firefox. If I remove the
width
and
float
though the
margin-top:0.15em;
seems to get affected as well, at least in firefox
can you please tell me exactly what you would like for your page...
the horizontal line should be on the left, like in firefox, and get to the end of the top navigation, which is not happening in IE7 only, where the line is in fact centered for some reason
thanks for your help guys, as usual : )!
Hi there,
you guys are right, I should have put the site up somewhere. I have just done it, the link is http://www.antobbo.webspace.virginmedia.com/webediting/home.htm
It's only the home page, I will add the rest as it comes along.
So as mentioned one of the problems is the horizontal line in IE7.
One thing I will mention, and I'm just guessing, is that you created a div for a horizontal line correct? Why didn't you just insert a horizontal line and style the line itself. Not that it wouldnt work that way, just overkill.
teedoff, The line is not in a div
What I'd suggest is NOT fun...
floatingDivs, What would you propose?
Please keep in mind that floating an element removes it from the normal flow of the page.
Arkinder, what do you mean exactly?
Ok thanks for that, it really makes the difference actually and sorts most of my problems out :) .
Still, something that that doesn't seem to fix (and I thought it would have been a problem with margins/padding) is the fact that the horizontal line below the navigation, which I set to float to the left, is instead displayed in the centre of the page in IE7 (and I think in IE6 too), whereas it is fine in IE8 and all the rest of the browsers. I thought it was applying some kind of padding which is why I thought that your trick would have solved it, but no, there seems to be something else...I downloaded this from the microsoft website http://www.microsoft.com/downloads/en/details.aspx?FamilyID=8e6ac106-525d-45d0-84db-dccff3fae677&displaylang=en which seems a nice tool, and I discovered that in IE7 there are an extra 187px of space between the horizontal line and the left margin. Not sure where this space is coming from but is there any way that I can remove it without applying a separate CSS for IE7 do you think?
My CSS now looks like:
*
{
margin:0;
padding:0;
}
h1
{
text-align:left;
font-size: 1.7em;
font-family: Arial, Verdana, sans-serif;
}
#banner
{
background:#81A594 url(typewriter.jpg);
background-repeat:no-repeat;
background-position:right;
height:120px;
padding:10px 50px 0 200px;
}
/*This is for the left hand side navigation */
#navigation ul /* for the navigation, foreground is a2c1b2 and bg is f5d9d7*/
{
list-style:none;
padding:0;
border:0;
margin:4em 0 0 0;
}
#navigation ul li
{
background: #f4d8c7 …
Hi ya, I know what you mean. when I was writing that little program I really didn't really noticed I included the namespace everywhere, so yes, I think you're right when you say that it was more like a "reflex action", but for me it has been always a matter of convenience in a way (it saves me typing std::). With hindsight, I now realized that yes having namespace in 3 files was surely not necessary at all because I had it into the .h file, so as a consequence of including the .h files in my cpp files they had it already, as you pointed out. aLSO from what I have read on the net (but I might be wrong) it looks like people tend to use the namespace in connection with global variables which I thought were something to be avoided and considered as poor style (I am not being judgmental here but this is what I was being taught and what I experienced myself).
I think it might take me forever to get the rid of that infamous namespace at the top of my programs though, will try to do it gradually, but thanks for your advice