Scott M's Profile
Reputation: 2
Apprentice
- Group:
- New Members
- Active Posts:
- 14 (0.07 per day)
- Joined:
- 14-November 12
- Profile Views:
- 117
- Last Active:
Jan 24 2013 04:57 AM- Currently:
- Offline
Previous Fields
- Dream Kudos:
- 0
Posts I've Made
-
In Topic: Live search position issues
Posted 24 Jan 2013
raghav.naganathan, on 24 January 2013 - 04:07 AM, said:
Scott M, on 24 January 2013 - 03:23 PM, said:Incidentally leaving "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">" out throws everything out. What does this piece of code actually do?
A really nice question indeed
/>
Well,the line you mentioned is called DOCTYPE. It tells your browser which version of HTML it is loading making the load time a bit quicker as the browser know what to expect.
The DOCTYPE declaration refers to a Document Type Definition (DTD)...in your example
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
What this means is this DTD contains all HTML elements and attributes, INCLUDING presentational and deprecated elements (like font). Framesets are not allowed. The markup must also be written as well-formed XML.
If you want more information regarding your question, I would suggest you look at this page.
regards,
Raghav
Magic, thanks
-
In Topic: Live search position issues
Posted 24 Jan 2013
Cheers
Here is the finished "example" code with all the styles that I've been using (just checking everything was OK.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <style type="text/css"> .popup { position: relative; width: 150px; } #layer2 { width: 150px; text-align: left; background-color:#FF9; } .addition { position:absolute; /*upwards rather than down.*/ bottom: 100%; } body { padding-top: 200px; } .textboxes { font-family: "MS Sans Serif"; font-size: 12px; background-color: #6CC; color: #000; border: thin solid #FF6; text-align: center; } </style> </head> <body style="width:1100px; margin:0 auto;"> <div> <table width="1100" border="1" cellspacing="0" cellpadding="0"> <tr> <td width="293" align="center" valign="middle"> <ul class="popup" id="popup" name="popup"> <div id="layer2" class="blue, addition" style="visibility:hidden">option1<br> option2<br> option3<br> option4<br> option5</div> <input name="search1" type="text" class="textboxes"style="width:150px" id="search1" value="Search Recipes....." title="Press enter to search." onclick="layer2.style.visibility='visible';" onblur="layer2.style.visibility='hidden';"/></ul></td> <td width="159" align="center" valign="middle"><label for="ingrtype"> <select name="type" class="textboxes" id="type"> <option value="">Ingredient Type</option> </select> </label> </td> <td width="147" align="center" valign="middle"><label for="ingredients2"> <select name="ingredients" class="textboxes" id="ingredients"> <option value="">Ingredient</option> </select> </label></td> <td width="491" align="center" valign="middle"><label for="qty2"> <input name="qty" type="text" class="textboxes" id="qty" /> <input name="Submit1" type="button" class="buttons" id="Submit1" value="Add"/> </label></td> </tr> </table> </div> </body> </html>
Incidentally leaving "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">" out throws everything out. What does this piece of code actually do?
In my initial example I had a 1px height for the popup and that line missing. When I put that line back in the 1px height misaligned the searchbox again, so I was on the hunt to find out what had caused it.
Thanks
-
In Topic: Live search position issues
Posted 24 Jan 2013
raghav.naganathan, on 24 January 2013 - 01:51 AM, said:Well, you wanted the search box to come in the middle right?
Also, what did you mean by unfortunately it then shifts the page ...I tried that in Firefox and chrome and no page shift seemed to take place.
Can you please elaborate on what you meant?
regards,
Raghav
I just found out what the problem was, I should kick myself.
I copied the code I used here, as I had only edited it to show an example, to see what it looked like and it looked perfect. Perfectly centred. The only difference in style between the original code and the code I used as an example is that I had set the font size in the popup... rather than the div. This difference in font size, compared to the rest of the page, was throwing off the textbox position.
Glad to have finally sorted it though, it was driving me mad. Thanks very much for your help
-
In Topic: Live search position issues
Posted 24 Jan 2013
I did try that before, but unfortunately it then shifts the page when the div becomes visible. With the popup class relative the popup overlays the rest of the page when the div expands within it.
Thanks for the help
-
In Topic: Looking for some help with security.
Posted 22 Jan 2013
Unfortunately this is all way over my head at the moment. I'm a complete novice as far as coding goes. I've picked up bits and bobs from searching around and built my website to the best of my ability, but what you just said means absolutely nothing to me at the moment. I have no idea what a prepared statement is or how to create one, although I'm guessing you mean that if someone were to choose the above as a username... pushing it through as a prepared statement would save it as the username without actually allowing any code to be executed based on it?
Through having a quick look at the link from above it's going to take a lot of reading and understanding to get me there. I had only just got my head around strip_tags and mysql_real_escape_string lol. I'm a learn by doing (wrong) kinda guy, trial and error till something works is how I've basically got to where I am
Currently working on a live search, it's been fun but I think I've got it. Will try it out in the website tomorrow
Ajax is really handy eh
My Information
- Member Title:
- New D.I.C Head
- Age:
- Age Unknown
- Birthday:
- Birthday Unknown
- Gender:
Contact Information
- E-mail:
- Private
Friends
Scott M hasn't added any friends yet.
|
|


Find Topics
Find Posts
View Reputation Given
|
Comments
Scott M has no profile comments yet. Why not say hello?