Profile

Cover photo
nitin niraj
Worked at Student
Attended DAV PUBLIC SCHOOL GANDHINAGAR
Lives in pune
195 followers|86,638 views
AboutPostsVideos

Stream

nitin niraj

Newbie Resources  - 
 
i am using json_encode for converting an array into json . The return which i am getting is  '      {"success":false,"errors":{"gender":"Gender cannot be blank"},"__all__":"All fields are required."}'. I want to remove the space from the start. I tried using trim but it did not work. any help 
1
Hans-Joachim Michl's profile photonitin niraj's profile photoJavier Telio's profile photo
3 comments
 
If you are unsure of the file(s) behaving nicely, you could start an output buffer beforehand and discard it afterwards...
Add a comment...

nitin niraj

Newbie Resources  - 
 
I am posting data from form. What i want is if there is any error the form should not go to other page rather it should stay in the same page and if everything is fine it should save the data in the database. I am pasting my code below:

<!DOCTYPE html>
<html>
<head>
</head>
<body>
<h1>Registration</h1>
<form method="post" action="registration.php">
First Name:<input type="text" name="fname"/><br/>
Last Name:<input type="text" name="lname"/><br/>
Password:<input type="password" name="password"/><br/>
Phone Number:<input type="text" name="phone"/><br/>
Email:<input type="text" name="email"/><br/>
College:<input type="text" name="college"/><br/>
<input type="submit" name="submit" value="Submit"/>
</form>
</body>
</html>

PHP code:
$required = array('fname', 'lname', 'password', 'college', 'phone', 'email');
$error = false;
foreach($required as $field) {
  if (empty($_POST[$field])) {
    $error = true;
  }
}
if ($error) {
  echo "All fields are required.";
} else {
  echo "Proceed...";
}
1
Jastor M's profile photonitin niraj's profile photohaclong ai's profile photoPierre Dudoret's profile photo
11 comments
 
you can try : submit form to registration.php, if error : redirect to your form page and ship there your error messages. If you're not using any framework, which i suspect, then use session to persist your error message... don't forget to empty your error message session so you won't display error when there's none. if no error -> update DB...

Or validate your form with javascript before going to registration.php
Add a comment...

nitin niraj

Beginners  - 
 
I am having a form which consist of text area. There is a timer on the page . As soon as the timer expires that text area should get disabled. Is there any way i can achieve it here.
2
Yury Tarabanko's profile photonitin niraj's profile photoBrian Adams's profile photo
3 comments
 
Try to keep it even more functional.

var myfunc = function (){
document.getElement ....
}
SetTimeout(myfunc, delay)

I this is more readable and the functional style leads to less side effects usually.
Add a comment...
 
Vars what exactly it does in python ? 
1
Justin Cook's profile photo
Add a comment...
 
Aspell spell checker for tinymce is not working properly. The problem which i am facing right now is if i put correct spelling in the text box for spanish. It is not doing anything. For example it should have shown me a message telling no miss spelling found but it is not doing that.  please help
2
Add a comment...

nitin niraj

Twitter Bootstrap Help  - 
 
Bootstrap 3 when used with pie htc IE . The dropdown are not being rendered properly. I have attached the screenshot for reference. Can anyone tell me what i am missing? Thanks in advance
1
Robert Khayat's profile photonitin niraj's profile photoColin Summers's profile photo
3 comments
 
Can you product a Jfiddle?
Add a comment...
Have him in circles
195 people
amit kr.'s profile photo
Manish Raj's profile photo
Srijit Chatterjee's profile photo
Vivek Hosmani's profile photo
Er.AMIT KUMAR's profile photo
Kunal Singh's profile photo

nitin niraj

Discussion  - 
 
i am using parsejson in jquery. It is throwing an error Uncaught SyntaxError: Unexpected token . 


$(document).ready(function(){
$("#submit").click(function(){
var data = $("#registration_form").serialize();
$.ajax({
url: "registration.php",
type: "post",
data: data,
success: function(data_server){
    console.log(data_server)
console.log('am i here')
var jso = jQuery.parseJSON(data_server);
console.log(jso.success)
if (jso.success) {
window.location.href = "question.php";
}else{
$('.error1').css('display', 'block');
$('.error1').text(jso.__all__)
}
},
error:function(data_server){
console.log(data_server)
}
});
})
})


i am using php for server side . I am sending data through json_encode. I am not getting what mistake i am making  any help would be appreciated. 
1
nitin niraj's profile photogreg keys's profile photoMike Behnke's profile photoChirag Jain's profile photo
9 comments
 
Honestly, while I love jQuery, I almost always just pull out the "old" JSON script from the json.org website rather than using jQuery to parse JSON.

Here's the GitHub repo: https://github.com/douglascrockford/JSON-js
Add a comment...
 
I am having a form which consist of text area. There is a timer on the page . As soon as the timer expires that text area should get disabled. Is there any way i can achieve it here.
1
Luca Zarotti's profile photoMohamed Alabbas's profile photoMichal Nusko's profile photoAndreas Jung's profile photo
5 comments
 
Same script just change property to prop...

setTimeout(function () {$("#messageBody").prop("disabled", true)}, 3000)
Add a comment...

nitin niraj

Newbie Resources  - 
 
I am having a form which consist of text area. There is a timer on the page . As soon as the timer expires that text area should get disabled. Is there any way i can achieve it here.
1
nitin niraj's profile photoMilo OSDATA's profile photo
2 comments
 
+Milo OSDATA Thanks
Add a comment...
 
Hello i am new to this shell scripting. I have to write a shell script which will copy a directory with all files and folders and paste it to another directory. i want to know about some tutorial for beginners or any help will be appreciated
1
1
Carlos Checo's profile photonitin niraj's profile photoMuthu Kannan's profile photoAlexander Nikitin's profile photo
6 comments
 
Some info. "-r" is for recursive copy. I think the CP command only copies files and skips Folders/Directories if that is not used.
Add a comment...

nitin niraj

Need Help (QnA)  - 
 
I am using php spell checker for different languages like spanish, german and english. The result which i am getting is having characters like 
\u00c3\u00ad. I am sending the data in JSON format. I want to get the original characters back which i am sending. any help would be appreciated. Thanks in advance
1
Jastor M's profile photo
 
Utf8_en/decode();
Add a comment...
 
I am using php spellchecker version 3.X .It is working fine in every browser except in internet explorer. When used in this browser it throws an error which states:

SCRIPT7002: XMLHttpRequest: Network Error 0x2ef3, Could not complete the operation due to error 00002ef3.

Any help would be appreciated if  i will know what i am missing. Thanks in advance
1
Jastor M's profile photoDark-Ao Raiden-X's profile photo
2 comments
 
That seems to be related to IEs crappy javascript engine and not anything to do with php.
Add a comment...
People
Have him in circles
195 people
amit kr.'s profile photo
Manish Raj's profile photo
Srijit Chatterjee's profile photo
Vivek Hosmani's profile photo
Er.AMIT KUMAR's profile photo
Kunal Singh's profile photo
Education
  • DAV PUBLIC SCHOOL GANDHINAGAR
Basic Information
Gender
Male
Work
Employment
  • Student
Places
Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Currently
pune
Previously
ranchi
Links