Jump to content

michaellunsford

Members
  • Content Count

    1,023
  • Joined

  • Last visited

Community Reputation

1 Neutral

About michaellunsford

  • Rank
    Prolific Member
  • Birthday 03/20/1973

Contact Methods

  • Website URL
    http://www.virtual-showcase.net
  • Yahoo
    xamblu

Profile Information

  • Gender
    Male
  • Location
    Louisiana, USA
  1. michaellunsford

    optional form field validation with patterns

    Odd. Checked a few places and it looks like you're right. It's an old habit of mine: if you open it, close it. Don't know that I can ever go back to the old HTML 4 methods.
  2. michaellunsford

    optional form field validation with patterns

    must have missed my edit -- does input no longer need to be closed in 5? It validates...
  3. michaellunsford

    optional form field validation with patterns

    ah hah! I knew there was a solution. I had searched for "default value" and a few other things -- the term "placeholder" escaped me for the moment. the space is pretty tight, so I had wanted to avoid the label. the placeholder is exactly what I was looking for. I am using HTML 5, btw. Validator says it's good. Why did you think I'm still on XHTML? 5 no longer requires closing the attribute?
  4. michaellunsford

    optional form field validation with patterns

    Sorry for the delay in replying. Phpfreaks notifications suddenly started going to the junk folder. ??? Anyway, you guys are both right. The ^/d{5}$ works fine. EXCEPT I was setting value="Zip Code" (it's not a five digit number, and it's not blank). That field has a javascript on it that blanks on focus or submit. Unfortunately, Firefox won't fire the submit script if the RegEx doesn't match. Sooo..... Is it possible to have a default value in an input field that doesn't match the RegEx? I'm thinking to just go all javascript and dump the pattern idea.
  5. michaellunsford

    optional form field validation with patterns

    <input type="text" maxlength="5" name="zip" value="Zip Code" pattern="(\d{5})?" /> So, if the zip code is filled, it should be a five digit number. If it's not filled it's optional. The above RegEx is forcing everyone to enter a zip code. Can HTML do this, or am I going to have to script it?
  6. michaellunsford

    jquery ajax .complete forgets what was clicked

    hum. thought this was local and that's why it didn't cross over. But, your solution works great. Thanks!
  7. This little bit of code fires a database insert and gets the keyfield ID number back. Everything works, except the last part: assigning the returned number to the ID attribute of the table cell that was clicked. Looks like $.ajax knows what $(this) is, but forgets before getting to .complete. How do I get the "this" variable to be recognized inside the .complete function? $('table td').click(function() { //user clicks a table cell alert($(this).index()); //test case returns '9' $.ajax({ url: "update.php", type: "POST", data: { action: 'clicked', clicked: $(this).index(), //the column that was clicked row: $(this).parent().attr('id').substr(4) //the row that was clicked (tr has an ID attribute like "row22") } }) .complete(function(data) { alert($(this).index()); //test case should return '9', but returns '-1' instead. console.log(data.responseText); //console gets the assigned id from a database insert -- works fine. $(this).attr('id','ros'+data.responseText); //doesn't work. did .complete forget what $(this) is? }); } I thought about making a hidden element, or global variable to assign $(this) to, but that seems like the long way around. Any other ideas?
  8. michaellunsford

    Anyone using Google or Amazon cloud for hosting?

    I'm wanting to install plesk, which requires a LAMP server (or my version does, anyway). Also curious about uptime, and the (legendary?) scalability of these environments.
  9. I'm running about 50 domains on a private host that's going out of business, so I need to move providers soon. The Amazon or Google cloud platforms are intriguing. Does anyone have any experience using either for website hosting? My current solution is a Plesk management interface. So, I'm hoping to install the same wherever I go (because migrating 50 domains manually ...)
  10. michaellunsford

    find lines that don't match RegEx?

    Very nice, Jacques! I have never heard of filter_var(). Thanks for sharing
  11. michaellunsford

    find lines that don't match RegEx?

    It's just a text file. No comma separated list or anything complicated like that. Just one email address per line. If Zane is right, it looks like I will have to depend upon PHP to do the work and not RegEx. Not a problem, I was just hoping that RegEx would have some kind of solution.
  12. michaellunsford

    find lines that don't match RegEx?

    One email address per line, thousands of lines. I was hoping to just use a text editor to do the work, but I may have to make a php loop to do it. here's the regex: ^([a-z0-9-_\.]+@[a-z0-9-_]+\.[a-z]{2,3})$ Tested the RegEx, and it works great. It returns thousands of lines of matched email addresses. Problem is, I only want it to find the lines that don't match. How do you make RegEx return unmatched lines?
  13. I can't seem to get the right search phrase together to find this on google. So far, all that comes up is how to save a form's POST results to a database. Anyway, the goal is to create a page where a user can build their own HTML form using a web GUI. I can pull it all together with a little AJAX, but getting stuck on how to store it. Things like check boxes and text fields seem simple enough. It'd just require a form_id, field_name, label, type_of_field, and default_value. But how to store a radio group or select option group?
  14. michaellunsford

    super slow relational query -- because: math

    It's not just "once in a while" this is a "just once" query. The data is being offloaded for a migration. By the way, all records (about 5,000) came through in under a second. For grins, I ran the EXPLAIN EXTENDED on it, but it looks like part of the answer was truncated by phpMyAdmin. I could run it from the command-line if you'd like. Also, I did check SHOW INDEX on both tables before running the query, and every field (including ones not called in the query) was indexed. id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE list ref PRIMARY PRIMARY 4 const 6422 100.00 Using index 1 SIMPLE subscriber eq_ref PRIMARY,idx_subscriber_confirmed,idx_s... PRIMARY 4 func 1 100.00 Using where edit: looks like the forum editor dropped the table the above was wrapped in :-/
  15. michaellunsford

    super slow relational query -- because: math

    Tell me about it. It's nuts! Who does that? Barand, that inner join did the trick. The query was nearly instantaneous! Now to see how 500 or 1000 records will do.
×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.