Jump to content

jimfog

Members
  • Posts

    1,803
  • Joined

  • Last visited

Posts posted by jimfog

  1. An AJAX request doesn't have to send anything. You can see some of the examples in the W3Schools tutorial that simply request data. An AJAX request will open the file as if it had been opened in the browser, there's no difference from the server side.

     

    Just for security, I wouldn't make it so easy to delete the account, I would request the user for his password, at least.

    Υes, you are right...I am going to request a password.

  2. I want to delete the account of a user using ajax-after clicking the corresponding button.

    The question is if it is necessary that any data must be send in the server at all.

     

    I do not know if ajax requests can be made without sending anything to the server

     

    I am going to delete the account based on the e-mail of the user(which is also used as the session variable).

     

    The php file will have code like this:

     session_start();require_once 'admin_db_code.php'; $sessionml=$_SESSION['valid_user'];  delete_account($sessionmail);

    So far I have used ajax only when submitting forms but now deleting an account with it... is an unknown "territory" for me.

    How I would do it?

    Thanks

  3.  

    You have to trigger the event and process to the specific element related using $(this)

    <label class="label" for="name">name</label><input id="name" value="" ><br><label class="label" for="lastname">lastname</label><input id="lastname" value="" >
    $('.label + input#name, .label + input#lastname').keyup(function(){     // var remove=$('.OK').remove();    if($(this).val()=="" || $(this).val()== this.defaultValue)    {     $(this).next('.OK').remove()       }    else    {    $(this).next('.OK').remove() // next element following the element $(this) that triggered the event    $(this).after('<span class="OK">OK</span>');       }     });

     

     

     

    I do not want to comment on the whole code mentioned in the whole topic but I just want to focus in the above segment and say some things:

     

    Why do you persist on using (this) and not using the selector itself...I know you are right but I want to here some explanation on it.

     

    I do not use code to look for empty string as shown above as this is taken care from the jquery validation plugin...http://jqueryvalidation.org/

    Here is the code using the plugins methods:

    $('input#name').keyup(function(){      var remove=$('.OK').remove();    if($('#formall #name').valid())    {        $(this).after('<span class="OK">OK</span>');    }});
  4. here is the code that does what i want...almost finished.

    $('input#name').keyup(function(){      var remove=$('.OK').remove();    if($('#formall #name').valid())    {        $(this).after('<span class="OK">OK</span>');    }});

    My problem now is that the OK does not stay there after I go to another an input element-that is reasonable because I am using the keyup event, I want the OK though to stay besides the input element even after I go to another input...

    Tale a look the code at fiddle to see the issue now.

     

    http://jsfiddle.net/fiddlehunt/bpAAS/34/

  5. Am in the beginning of learning git.

     

    I have set up a mail and a username but I want to know with which command I can see what are the above.

     

    I am talking about a command in git bash.

    Surely I can find what I want by looking at the config file, but I want to get the info from git bash command line utility

  6. Now your code works.

    But lets's for a moment that I do not want to put the input element inside the label.

     

    Is there another method that can do what I want-achieving the same effect WITHOUT as I said putting the input inside the label.

     

    I just want to avoid changing the markup as the form has many fields.

     

    I USED After instead of appendTo

  7. So far, when using if/else statements I have never used endif without this being the source of any problems.

     

    Do you think that endif has any usefulness at all?

  8. I am using COUNT to see how many rows exist in a specific table.

     

    My question is how am I going to print the result in the browser since in

    such a case the query returns only a number and not a specific row which

    I could get with fetch object or something similar.

     

    Thanks

  9. Recently I updated MySQL community server to 5.1.70 from 5.1.67.

    The problem is that despite in MySQL workbench the new version is shown as running,in PHPMyAdmin the old version is shown,meaning:

     

    • Software version: 5.1.63-community - MySQL Community Server (GPL)

    Why that do you think?

  10. I will see what options PEAR has to offer.

    But I have 1 more question to make-a small one.

     

    When I get a mail in Outlook I often see in the from field the mail the mail of the sender along with a name.

    Example:

     

    Test nesletter(test@nesletter).

     

    Is it possible to adjust the header section of the mail function such that I can have the above result?

    Or do I have to do it manually?

  11. The mail() part of the manual shows an example of how to break a string onto 70-character lines.

    I suppose you mean this.

     

    $message = wordwrap($message, 70, "rn");

  12. But you think I do?

     

    Here's the basic idea: if trimming the data would affect form validation, then trim it. If it's not going to affect validation then it doesn't matter.

    Of course I do not expect from you to know the requirements of my application.

    I was asking just to know if there is a standard approach used by developers in this matter.

  13. In the PHP manual it is stated that the length of the lines of a message handled by the mail function should not exceed 70 characters.

     

    Does that mean-in other words- that when setting a textarea for the message body of a contact form(for example) its cols attribute must not exceed 70?

     

    Am I correct on the above?

  14. It depends on the requirements for your site, do what works for your site. If you need to trim the data before you validate in Javascript, then trim it.

    Well...the issue here is I DO NOT know if my site would require such functionality.

    I intend using trim in a form where the user can edit its profile...name,phone,e-mail etc...

    It is a pretty standard type of form I think.

    What I should do?I intend using trim.

     

    Is there any argument NOT to use it from the description I gave above?

×
×
  • Create New...