Jump to content

funbinod

Members
  • Content Count

    499
  • Joined

  • Last visited

Posts posted by funbinod

  1. sorry! i again need to come back in this topic.

     

    the error in the ajax request is solved (i think) but its each time returning error function.

     

     

    this is the ajax request

    $(document).ready(function(e) {
    	$('#vname').blur(function(e) {
    		$.ajax({
    			url:"ajax/aid.php",
    			dataType:"jsonp",
    			contentType:"text/xml",
    			type:'GET',
    			data: {
    				name: $('#vname').val()
    			},
    			success: function(result) {
    				$('#vaid').val(result);
    				$('#vname').css('background-color', '#1CDC06');
    				$('#vamt').focus();
    			},
    			error: function() {
    				$('#vname').focus();
    				$('#vname').css('background-color', '#FF0');
    			}
    		});
        });
    });
    
    

    and this is the url where i send data and get data back...

    header("content-type: text/xml");
    $name = trim($_GET['name']);
    if ($stmt =  $mysqli->prepare("SELECT aid FROM account WHERE name=? AND cid=?")) {
    	$stmt->bind_param('si', $name, $cid);
    	$stmt->execute();
    	$stmt->bind_result($aid);
    	$stmt->fetch();
    	echo $aid;
    }
    

    i also checked network tab as you suggested. it shows status 200. but still returns the error function. please guide me..

  2. no. its not working even after removing the semi-column

    	$('#vname').blur(function(e) {
    		$.ajax({
    			url:"ajax/aid.php",
    			data: {
    				$('#vname').val()
    			},
    			error: function() {
    				$('#vname').focus();
    				$('#vname').css('background-color', '#F00');
    			},
    			dataType:"jsonp",
    			success: function(result) {
    				$('#vaid').val(result);
    				$('#vname').css('background-color', '#1CDC06');
    				$('#vamt').focus();
    			},
    			type:'GET'
    		});
        });
    
    
  3. thank u. its much helpfull.

     

    i checked the console and it said there is a "syntax error" on the following line

    			data: {
    				$('#vname').val();
    			},
    
    

    after i delete the line and execute the blur function, i receive the data from error function

     

    what could be the problem on the line?

  4. hello all! greetings!

     

    ​i'm trying to learn jquery ajax request. before i was using xml http request.

     

    after learning online, i tried the following code but its not working.

    	$('#vname').blur(function(e) {
    		alert('checking');
    		$.ajax({
    			url:"ajax/aid.php",
    			data: {
    				$('#vname').val();
    			},
    			error: function() {
    				$('#vname').focus();
    				$('#vname').css('background-color', '#F00');
    			},
    			dataType:"jsonp",
    			success: function(result) {
    				$('#vaid').val(result);
    				$('#vname').css('background-color', '#1CDC06');
    				$('#vamt').focus();
    			},
    			type:POST
    		});
        });
    
    

    please anyone help me learning this.

     

    thank u.

  5. hello all!

     

    i've written the following table update code

    $updateq = $mysqli->prepare("UPDATE user SET address=?, phone=? WHERE uid=?");
    if(!$updateq) {
    	$_SESSION['err'] = "There is some error updating user info!";
    	die(header("location: uman.php?uid=$userid"));
    } else {
    	$updateq->bind_param('sii', $addr, $phone, $userid);
    	if (!$updateq->execute()) {
    		$_SESSION['err'] = "There is some error executing user update!";
    		die(header("location: uman.php?uid=$userid"));
    	} else {
                    // success
    		?>
                    <script>
    		alert('User info updated successfully!4');
    		window.opener.location.href = 'admin.php?m=man-u';
    		window.close();
    		</script>
                    <?php
    		}
    	}
    }
    

    this generates the success alert but the table doesn't get updated. can anyone please point towards my mistake??

     

    thanks in advance..

  6. Each browser renders the progress bar in its own way, that feature doesn't seem to exist in Firefox. If you were looking for something you had more control over you could use <div> tags with custom styling the way Bootstrap does it.

     

    but the default <progress> bar on firefox and chrome is animated. only after stylling there is no any animation.

  7. I don't see the value written in text format when I test in Firefox. To change the color of the bar, change the background-color of the ::-moz-progress-bar and ::-webkit-progress-bar pseudo-elements.

     

    sorry! i think i couldn't make u understand clearly.

     

    i meant that the <background-color> defines the color of the progress bar. but there is no any progressing (or running) dots (like they appear on IE inside the progress bar..

  8.  

    This works for me.

    Be sure to add a value attribute and a max attribute.

    <progress value="50" max="100"></progress>
    progress {    background-color:#EFD259;}progress::-moz-progress-bar {    background-color:#F00;}progress::-webkit-progress-bar {    background-color:#F00;}

     

    and the color of the value???

    color:#FF0;
  9.  

    When testing this in Firefox it works for me:

    progress::-moz-progress-bar {    width:100%;    color:#F00;    background-color:#EFD259;    height:30px;    border-radius:10px;    border:2px solid #FFF;}

    but its not working for me in firefox either..

     

    i'm using firefox 41.0.2

     

    EDIT:

    it styles the progress bar but doesn't display the progress...

  10. i want to sum each value from the retrieved values from an array. but i'm failing in this

     

    like, i get $balance for each $aid

    $ttl = 0while ($r = $q->fetch_array) {    // ..................    // ..................    $aid = $r['aid'];    $balance = $r['balance'];}$ttl += $balance;$totamtarr[ $aid ] = $balance;$runSum = 0;foreach($totamtarr as $clamt) {    $runSum += $clamt;    $total[] = $runSum;}echo $total;

    but this $total say -> "Array to string conversion in.................."

     

    please guide.

     

    thanks in advance...

  11. i was trying to style my progress bar with css. it worked fine with only IE but not with other browsers - chrome, firefox, opera.

     

    the following is what i tried

    progress {	width:100%;	color:#F00;	background-color:#EFD259;	height:30px;	border-radius:10px;	border:2px solid #FFF;}progress::-webkit-progress-bar {	width:100%;	color:#F00;	background-color:#EFD259;	height:30px;	border-radius:10px;	border:2px solid #FFF;}progress::-webkit-progress-value {	width:100%;	color:#F00;	background-color:#EFD259;	height:30px;	border-radius:10px;	border:2px solid #FFF;}

    https://jsfiddle.net/kza8ykxx/

     

    please guide me to the perfect progress bar styling..

     

    thanks in advance...

  12. Since when?

    i dont know. but in one of d books i read, it was said styling with css is better than using h tags..

     

    and j.silver's prolem will be solved using span tag in stead of h tag

  13. I also tried

    $total += $balance;

    and it also doesn't work.

     

    actually the $balance is derived from lots of calculations after the query so I don't know how can I make the sum of $balance in sql. that's why I wish the $total calculated with php...

×
×
  • Create New...