Click here to Skip to main content
15,898,035 members

Comments by careLess - Eric (Top 7 by date)

careLess - Eric 5-Mar-14 0:50am View    
Thanks for the link, but nothing is work for me, some of the code worked but it only display my computer IP address..
careLess - Eric 15-Feb-14 2:13am View    
hi thanks for the reply but i think you misunderstood my question or maybe my question is not that clear for you :). i know how to populate my listbox using store procedure my problem is after i populate my listbox i cant get the items selected in that listbox.
careLess - Eric 16-Oct-13 8:49am View    
hehe sorry.. but i already solved the problem.. but my another problem using this code is that i can't pass the username going to displayInfo.php page for me to query in the database.. how could i do that please provide simple example for this.. thanks
careLess - Eric 14-Oct-13 8:44am View    
yah of course i open a mysql connection and selecting dbase just dont know how can i pass this validated data through my functions.php: for me to insert.

can you help me with this part of jquery:

$.ajax({
type: 'POST',
cache: false,
contentType: "application/json; charset=utf-8",
url: 'functions.php/f1',
data: "{'var1':'" + document.getElementById('username').value + "', 'var2':'" + document.getElementById('password').value + "', 'var3':'" + document.getElementById('accesslvl').value + "'}",
async: false,
success: function (response) {
$('#username').val('');
$('#password').val('');
$('#accesslvl').val('');
alert("Record Has been Saved in Database"); },

error: function ()
{ console.log('there is some error'); } });
careLess - Eric 14-Oct-13 2:13am View    
thanks, but how can i do that? this is my current code in jquery..


$( "#dialog-form" ).dialog({
autoOpen: false,
height: 300,
width: 350,
modal: true,
buttons: {
"Create an account": function() {
var bValid = true;
allFields.removeClass( "ui-state-error" );

bValid = bValid && checkLength( username, "username", 3, 16 );
bValid = bValid && checkLength (password, "password", 3, 100);
bValid = bValid && checkLength( accesslvl, "accesslvl", 1, 5 );

bValid = bValid && checkRegexp( username, /^[a-z]([0-9a-z_])+$/i, "Username may consist of a-z, 0-9, underscores, begin with a letter." );
// From jquery.validate.js (by joern), contributed by Scott Gonzalez: http://projects.scottsplayground.com/email_address_validation/
bValid = bValid && checkRegexp( password, /^([0-9a-zA-Z])+$/, "Password field only allow : a-z 0-9" );
bValid = bValid && checkRegexp( username, /^[a-z]([A-Z])+$/i, "Access Level must be consist of letters only." );

if ( bValid ) {
$( "#users tbody" ).append( "<tr>" +
"<td>" + username.val() + "</td>" +
"<td>" + password.val() + "</td>" +
"<td>" + accesslvl.val() + "</td>" +

"</tr>" );

$.ajax({
type: 'POST',
cache: false,
contentType: "application/json; charset=utf-8",
url: 'functions.php/f1',
data: "{'var1':'" + document.getElementById('username').value + "', 'var2':'" + document.getElementById('password').value + "', 'var3':'" + document.getElementById('accesslvl').value + "'}",
async: false,
success: function (response) {
$('#username').val('');
$('#password').val('');
$('#accesslvl').val('');
alert("Record Has been Saved in Database");
},
error: function ()
{ console.log('there is some error'); }
});

$( this ).dialog( "close" );
}
},
Cancel: function() {
$( this ).dialog( "close" );
}
},
close: function() {
allFields.val( "" ).removeClass( "ui-state-error" );
}
});

this is my code in functions.php: