Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

1 Neutral

About michaellunsford

  • Rank
    Prolific Member
  • Birthday 03/20/1973

Contact Methods

  • Website URL
  • Yahoo

Profile Information

  • Gender
  • 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?

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.