Jump to content

Don E

Members
  • Posts

    996
  • Joined

  • Last visited

Everything posted by Don E

  1. Yes you can use <form>. Within the form, you can have two input fields for example that accepts input from the user asking how many rows they would like(one input field) for the table and how many columns they would like(another input field). Then have the form submit to a function where in the parameter of the function, you're sending the whole form so that you can have access to input fields. For example: <script type="text/javascript"> function makeTable(form){var rows = form.rows.value;var cols = form.cols.value; // code to make table ... } </script> <form method="post" action="#"> <!-- or instead can have onSubmit("return makeTable(this);") here; make sure to return false and to remove the onclick from the submit button -->How many rows:<input type="text" name="rows" /><br/>How many cols:<input type="text" name="cols" /><br/><input type="submit" value="Create Table" onclick="makeTable(this.form);" /></form> Or another way: <script type="text/javascript"> function makeTable(rows, cols){// rows and cols contain the values inserted by the user// code to make table ... } </script> <form method="post" action="#" >How many rows:<input type="text" name="rows" /><br/>How many cols:<input type="text" name="cols" /><br/><input type="submit" value="Create Table" onclick="makeTable(this.form.rows.value, this.form.cols.value);" /> </form>
  2. This can probably help you determine what it is: http://www.myfonts.com/WhatTheFont/
  3. I see. Best would be to post your updated/recent code. This can help in determining where the problem is.
  4. Welcome. It happens to all of us from time to time..
  5. Don E

    Security

    So Called, You made a very interesting point that crossed my mind before about people trying to run include files directly in their browser... Can you give us a quick example of your tip? Would appreciate it.
  6. Try escaping the single quotes like the following and give the document a doctype: <!doctype html><html><head><script type="text/javascript">function init(){ document.writeln('<TABLE border=1>'); document.writeln('<TR bgcolor="#FFFFFF" onMouseOver="this.bgColor=\'gold\';" onMouseOut="this.bgColor=\'#FFFFFF\';">'); document.writeln('<TD>Mauritania</td><TD>21N</TD><TD>24N</TD><TD> </TD><TD> </TD> </TR>'); document.writeln('<TR bgcolor="#FFFFFF" onMouseOver="this.bgColor=\'gold\';" onMouseOut="this.bgColor=\'#FFFFFF\';">'); document.writeln('<TD>Myanmar</td><TD> </TD><TD>M TBA</TD><TD>M TBA</TD><TD> </TD></TR>'); document.writeln('<TR bgcolor="#FFFFFF" onMouseOver="this.bgColor=\'gold\';" onMouseOut="this.bgColor=\'#FFFFFF\';">'); document.writeln('<TD>Nepal</td><TD> </TD><TD> </TD><TD> </TD><TD>M TBA</TD></TR></TABLE>');}</script></head><body onload="init()"></body></html>
  7. Look a little closer at the div.. you're missing something important there.. also.. using double quotes is preferred for attributes. Hint: It goes between the attribute and the value assigned to it.
  8. It maybe because you set the image to display: block. A block element will take up all available space thus pushing something up or down. One thing you can try is put the links in a <ul>(since I believe you want them links to be stacked on top of another), float that left and then float the image right. They should be on the same line. The only problem with this though is the ul might be way on the left of the screen and the image on the right. What you can do for that is put them inside a container like a div and give it a specific width and then to center the container, you can do margin: 0 auto; but of course this all depends on the overall layout of your page.
  9. Don E

    Styling Forms

    I see why you're frustrated. When I mentioned label in the first post, I was referring to the 'label' of an input element and the text that's between <label></label>, for example: <label for="name">First Name:</label><input type="text" id="name" name="fname" /><br/> When I said: 'since the label of an input field can be longer than another(the label as in the text inside <label></label> that makes the input boxes(<input type="text" id="name" name="fname" />) uneven with the next input box/element if the label is a shorter word for that input box/element. i.e: <label for="name">First Name:</label><input type="text" id="name" name="fname" /><br/><label for="email">Email:</label><input type="text" id="email" name="mail" /><br/> Like shown here: If my overall question confused you, it maybe because I started off asking in general of what's recommended/suggested ways of styling forms and then gave a precise example of what I was referring to by saying this: In other words, since the label of an input field can be longer than another, that makes the input boxes uneven like the following, basically asking what are some of the forum members ways/suggestions/opinions of handling this. Hence why I gave an illustrative example of what I was referring to by providing the attached image. Hopefully this post explains better.
  10. Don E

    Styling Forms

    Ah man.. I was referring to that. lol Apologies for the confusion. Thats why I was like to myself and then posted.. what in the world is he asking to explain that.. because I was referring to what you are referring to but my mistake for spelling it incorrectly, No, the main issue is addressed in the first post. For some reason when I picture "tables", I see them as 'tubes(columns)' of data stacked next to each other hence why I say/said "tubular".
  11. Don E

    Styling Forms

    Explain what? Are you being serious? You're making a big deal out of nothing man. Did you not understand what I wrote or did you misinterpret it? I KNOW you can use tables to design/style a form, I mentioned this in the first post, but tables in today's' standards(of designing sites) from my understanding should be used for tubular data and NOT for any kind of layout, forms included. IF I am wrong, I am wrong, big deal. What are you trying to say, that the example form I quickly made to use for an example to better help me illustrate my question, is "tubular data-like" and should use a table there then?
  12. Don E

    Styling Forms

    Elaborate on what? Did you not read post #11? I basically explained why I started this thread.
  13. Don E

    Styling Forms

    I was just asking how some of the forum members here address the issue that was asked in the first post... is there something wrong with that? I was and am fully aware of the many ways forms can be styled and I wanted to know from the forum members perspective what's their preferred way of addressing the issue that was mentioned in the first post. CodeName gave his way for example; table. dsonesuk suggested basically what I was looking for because I didn't want to resort to using a table. IMO nothing wrong with tables, just that in today's standards, I think it's best to use table for showing tubular data instead of using for layout.
  14. Don E

    Styling Forms

    My apologies, I didn't mean to get that wrong. What would you recommend/suggest on how to get a particular input element centered, like the submit button? Because I noticed when trying to target a specific input element and since input elements are inline by default and using text-align: center, I thought that would do the trick. But the only way text-align: center works is if targeting the parent container which is the form itself and then applying text-align: center to that. Thanks, I appreciate it!
  15. Don E

    Styling Forms

    Thanks CodeName and suk. Suk, Do you mean something like this: label {display: block;float: left;width: 110px;} This is the result: Thanks.
  16. Foxy, Can you give us an example on how to hash the cookie or the route you'd take in doing that? Thanks.
  17. Interesting posts... I just add my two sense in regards to it being cheating or not: IF you are really good with JavaScript, I mean good as in you can do/make a lot of the things jquery does but instead decide to still use jquey EVEN when you have the time to make your own, then in a way.. in my opinion that's cheating(not necessarily, but in a way). IF you are learning JavaScript or aiming to learn it, but always use jquery for everything, then you're preventing yourself from really learning JavaScript. IF you tell your client or the person you're making the site for, that you do ALL the coding, I mean ALL the coding and use jquery to do a lot of fancy stuff etc, then that's cheating in a way but more like being untruthful. IF you don't care or don't want to learn JavaScript and/or don't have time to make your own, then using jquery of course is alright. That's what it was intended for I believe, for those kind of people. So all in all, I guess it depends on the individual and situation. If Douglas Crockford always used jquery for everything he does and then presents his work as in he did it himself, then that's cheating/being untruthful imo. I am not against jquery, I think it's really nice, but if you want to learn JavaScript itself and master the language, I suggest staying away from it for awhile. If you were to get a job at some developing company and they asked you to make something in JavaScript and then you turn to your friend and say "yes! I can do it with jquery, shh!" and then they come back and say "oh hey, forget to mention.. don't use any JavaScript library like jquery etc", you'll be sitting there scratching your head. So in the end, I guess it depends.
  18. Don E

    Styling Forms

    Hey everyone, What are some of the ways some of you style your forms... or better put.. what's suggested/recommended when it comes to styling forms? In other words, since the label of an input field can be longer than another, that makes the input boxes uneven like the following: <form method="post" action="somepage.php" ><fieldset><legend>Example Form</legend><label for="name">Name:</label><input type="text" id="name" name="fname" /><br/><label for="mail">Email Address:</label><input type="text" id="mail" name="email" /><br/><input type="submit" value="Send" name="submit" /></fieldset></form> This is how the above form displays: Is it better to target everything individually or put each element in a div container and then style it like that... or.. use table? Thanks.
  19. Don E

    Syntax for PHP files

    So Called, No no.. no disrespect taken. I actually think many of your posts are very informative and helpful.
  20. Don E

    Syntax for PHP files

    We were waiting for you to post a detailed explanation about the question at hand.
  21. Don E

    Syntax for PHP files

    If you're not processing any kind of PHP code in the file and just using it to include the header section of your website, then no, don't need. The file can be a .html file as well: header.html as long as no PHP code is being processed.
  22. Don E

    Syntax for PHP files

    If you have a file called: page.php In that file you still need <?php ?> for the PHP code to be processed despite it being a .php file.
  23. Don E

    Syntax for PHP files

    Yes, it's how the file is interpreted/processed.
  24. Don E

    Security

    Interesting replies so far. Do you guys recommend using PHP's built in filtering and sanitation for processing input uploads etc?http://www.php.net/manual/en/book.filter.php
  25. Don E

    Security

    Hello everyone, I thought I would start a topic about security in regards to web development. 'So Called' made some interesting threads worth taking a look but in this thread I thought I'd ask some general questions in regards to making sure your website is secured... well.. at least for the most part. :)Basically, what is the number one concern when it comes to your websites' security? Is it the database? Of course it is how you process form information, but when it comes to 'hackers' etc, what are most likely their goals/objectives when trying to compromise your website? Yes I know it depends on the site of what their goal would be, but I'm asking in a more general/overall way.I remember years ago on mIRC there were and probably still are channels(chatrooms) that promoted things of the above, like "getting access to the .htaccess file" was one of them for example. They would get username and password lists from certain sites via htaccess file because of the HTTP authentication some sites used to log-in in users. Some site owns learned about this and do now form-based log-in's which we see almost everywhere now. With the HTTP authentication route some sites took for logging in users, there were and probably still are programs where you load a username/password combo word list and scan the site. I'm sure that over all security probably most likely has to do with your hosting company settings etc, but in regards to the developer, what are some required/suggested routes to go when it comes to designing/developing the site besides using good username/password for logging into your cPanel and database(s)? Appreciate it. Thanks.
×
×
  • Create New...