![](http://content.invisioncic.com/r49260/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
jimfog
-
Posts
1,803 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by jimfog
-
-
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
-
It seems suspicious that you need a selector with two id's when id's are unique.
Yes you are right...no need for both Id's
-
thanks both...
-
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>'); }});
-
WHERE DID YOU SEE THAT?
-
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.
-
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
-
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
-
Neither of the above achieve what I want...for clarity take a look at the the picture
https://skydrive.live.com/redir?resid=BE27434B2AAC8130!256&authkey=!AAC_RLgOGejY7s0&v=3
Copy And paste the whole link.
-
I am trying to append content on an input element on keyup but my code does not work:
Here is the fiddle link:
http://jsfiddle.net/fiddlehunt/bpAAS/15/
What is wrong with the above code?
-
conditionals
in PHP
thanks
-
conditionals
in PHP
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?
-
using COUNT
in SQL
I really had no idea you were talking about this...which by the way is completely unfamiliar to me.
-
using COUNT
in SQL
Give the value an alias and use that as the column name.
Can you give me an example?
-
using COUNT
in SQL
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
-
MySQL update
in SQL
You mean 5.1.70 is older than 5.1.67?
-
MySQL update
in SQL
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?
-
mail function
in PHP
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?
-
mail function
in PHP
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");
-
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.
-
mail function
in PHP
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?
-
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?
-
any comment on the above?
-
All in all.it seems an ajax contact form with a status confirmation message will be OK
deleting account
in JavaScript
Posted
Υes, you are right...I am going to request a password.