how to submit form using jquery without refreshing page


Sir,

how can I submit form without refreshing page using jquery or Ajax.

Posted On: Thursday 22nd of November 2012 11:00:04 PM Total Views:  188
View Complete with Replies

RELATED TOPICS OF JavaScript PROGRAMMING LANGUAGE




submittin forms

i am trying to submit three forms with the one button using javascript. here is my code function submitForms(){ document.dropdown.submit(); document.radio.submit(); document.form.submit(); } function textLimit(field, maxlen) { if (field.value.length > maxlen + 1) alert('your input has been truncated!'); if (field.value.length > maxlen) field.value = field.value.substring(0, maxlen); } Construction Electrical Technical News Section:: General News: Internal News: Date:  Title:   Article: the data which i want to send to the next page does not seem to being passed over though. when i try to echo out the variables nothing is being printed on the page. any help would be great
VIEWS ON THIS POST

77

Posted on:

Monday 19th November 2012
View Replies!

Problems with form submition

I have a form that I'm trying to submit but it just doesn't want to play nice. The form i have has 2 submit buttons. One processes php code that updates info in a DB and the other deletes the info in the DB. The problem is that I have a popup asking for confirmation on the deleting and when I click ok nothing happens. I need to know is how to submit my form using javascript so that it processes the PHP code to delete the DB entry. form tag and delete button
VIEWS ON THIS POST

87

Posted on:

Monday 19th November 2012
View Replies!

Question about FORM submit

In html page I have two forms: [html] [/html] Now the question is if I submit "fm2", is it possible to also submit the text area which is in "fm1" I don't want to repeat the same text area in both "fm1" and "fm2", so this text area can either submit to "fm1", or "fm2".
VIEWS ON THIS POST

99

Posted on:

Monday 19th November 2012
View Replies!

calling several javascript functions at the form submit

Hi all, I have a programme where I have 50 questions . I have written js functions to validate each. but now problem is at form I cant't call every methode. so I have to put all code into one methode and check. Is it ok are there any alternative option thx in advanc....
VIEWS ON THIS POST

140

Posted on:

Wednesday 21st November 2012
View Replies!

Form data not submitted

I'm trying to submit form data to mysql database. The POST form action calls a javacript/ajax httpRequest. My php script has a redirect at the end of it on completion of data submission. My problem is after submitting the form, the redirection works, but no data is entered into database. I'm wondering if there is a problem with my httpRequest. Any help appreciated. function submitPrefs(){ var URL = './PHP/submitPrefs.php'; var xmlhttp=false; try{ xmlhttp = new ActiveXObject('Msxml2.XMLHTTP'); } catch (e){ xmlhttp = false; } try { xmlhttp = new ActiveXObject('Microsoft.XMLHTTP'); } catch (E) { xmlhttp = false; } if (!xmlhttp && typeof XMLHttpRequest!='undefined') { try { xmlhttp = new XMLHttpRequest(); } catch (e) { xmlhttp=false; } } if (!xmlhttp && window.createRequest) { try { xmlhttp = window.createRequest(); } catch (e) { xmlhttp=false; } } var I = document.getElementById['I']; var C = document.getElementById['C']; var F = document.getElementById['F']; var SS = document.getElementById['SS']; var MS = document.getElementById['MS']; var B = document.getElementById['B']; var SSA = document.getElementById['SSA']; var MSA = document.getElementById['MSA']; var S = document.getElementById['S']; var D = document.getElementById['D']; var L = document.getElementById['L']; var SR = document.getElementById['SR']; var DR = document.getElementById['DR']; var FG = document.getElementById['FG']; var BG = document.getElementById['BG']; var O = document.getElementById['O']; var G = document.getElementById['G']; var BY = document.getElementById['B']; var M = document.getElementById['M']; var MX = document.getElementById['MX']; var FR = document.getElementById['FR']; var VR = document.getElementById['VR']; var ML = document.getElementById['ML']; var CL = document.getElementById['CL']; var DL = document.getElementById['DL']; var params = 'I='+I+'&C='+C+'&F='+F+'&SS='+SS+'&MS='+MS+'&B='+B+'&SSA='+SSA+'&S='+S+'&D='+D+'&L='+L+'&SR='+SR+ '&DR='+DR+'&FG='+FG+'&BG='+BG+'&O='+O+'&G='+G+'&B='+BY+'&M='+M+'&MX='+MX+'&FR='+FR+'&VR='+VR+'&ML='+ML+'&CL='+CL+ '&DL='+DL; xmlhttp.open('POST', URL, true); xmlhttp.send(params); xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState == 4 && http.status == 200) { return; } } }
VIEWS ON THIS POST

83

Posted on:

Wednesday 21st November 2012
View Replies!

prevent submit on empty input - validation problem

function echeck(str) { var at="@" var dot="." var lat=str.indexOf(at) var lstr=str.length var ldot=str.indexOf(dot) if (str.indexOf(at)==-1){ alert("Invalid Email") return false } if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){ alert("Invalid Email") return false } if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){ alert("Invalid Email") return false } if (str.indexOf(at,(lat+1))!=-1){ alert("Invalid Email") return false } if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){ alert("Invalid Email") return false } if (str.indexOf(dot,(lat+2))==-1){ alert("Invalid Email") return false } if (str.indexOf(" ")!=-1){ alert("Invalid Email") return false } return true } function Validate(){ var email=document.successfrm.email var batchid=document.successfrm.batchid var sname=document.successfrm.sname if ((sname.value==null)||(sname.value=="")){ alert("Please enter the Student Name") user.focus() return false } if ((batchid.value==null)||(batchid.value=="")){ alert("Please enter the Batch ID") pass.focus() return false } if ((email.value==null)||(email.value=="")){ alert("Please enter your Email") email.focus() return false } if (echeck(email.value)==false){ email.value="" email.focus() return false } return true } Student Name Batch ID Email The form submits even if no input is provided. The database get updated with blank values. Please help me. This post has been edited by crafty: 14 April 2010 - 05:34 AM
VIEWS ON THIS POST

103

Posted on:

Wednesday 21st November 2012
View Replies!

onClick="form.submit(); doesn't work on IE & Opera

Hi. I have a code (see below), in Firefox it works perfectly: it saves submitted information after clicking __JL_SAVE button and keeps user on same page. But in Internet Explorer & Opera it only redirects to index page (index.php) and doesn't save submitted information. What can I do for solving this problem
VIEWS ON THIS POST

65

Posted on:

Wednesday 21st November 2012
View Replies!

Javascript form not submitting

, first post over here. I've been doing javascript for 2 weeks, so bear with me. I basically created form that has all the dynamic features I want, However it does nothing on submit. I have tried changing the action/method - but no go. Any ideas
VIEWS ON THIS POST

90

Posted on:

Wednesday 21st November 2012
View Replies!

how the chat screen is refresh to bottom after the send button submit


VIEWS ON THIS POST

245

Posted on:

Wednesday 21st November 2012
View Replies!

jQuery external form page loaded in div. how to submit to same div?

Hi I'm calling an ajax load to put my external form in a div instead of iframe, but then how do i make this form submit to the same div $('#res_details').live('submit', function() { $.ajax({ data: $(this).serialize(), type: $(this).attr('method'), url: $(this).attr('action'), success: function(response) { parent.$("#res_remote_content").html(response); //this is the div i want to show the submit result in } }); return false; }) What I want is for the form to behave exactly as if it were in an iframe. Can't figure it out MOD EDIT: Added code tags. When posting code...USE CODE TAGS!!! This post has been edited by JackOfTrades: 09 December 2011 - 04:37 PM
VIEWS ON THIS POST

186

Posted on:

Wednesday 21st November 2012
View Replies!

Need submit button to be disable after 10 submissions

The codw which i am using is , the code which i am using is able to disable the submit session , but not exactly that i need, i need to disable that after 10 submissions and timer will become start for 24 hours , to enable again
VIEWS ON THIS POST

86

Posted on:

Wednesday 21st November 2012
View Replies!

form validation and submitting

all.
VIEWS ON THIS POST

67

Posted on:

Wednesday 21st November 2012
View Replies!

automatically submition of quiz after certain period of time

hello frnds, i want to run a quiz competion on my website in which after logging any user play that quiz, like i will give 50 question to solve in just 3 min time, all will be objective question, now after that 3 min, quiz will automatically end and all users marked answer entered to the database, means he has not press any submit button, but after specific time all answer automatically enter in the database, and he come out from it.. now im using this timer, Untitled Document Quiz System var days = var hours = var minutes = var seconds = function setCountDown () { seconds--; if (seconds < 0){ minutes--; seconds = 59 } if (minutes < 0){ hours--; minutes = 59 } if (hours < 0){ days--; hours = 23 } document.getElementById("remain").innerHTML = days+" days, "+hours+" hours, "+minutes+" minutes, "+seconds+" seconds"; SD=window.setTimeout( "setCountDown()", 1000 ); if (minutes == '00' && seconds == '00') { seconds = "00"; window.clearTimeout(SD); //window.alert("Time is up. Press OK to continue."); // change timeout message as required window.location = "http://www.lucknowmail.com" // Add your redirect url } } Start Time: End Time: pl help me , and tell me where to bring changes or which new thing is to be added
VIEWS ON THIS POST

135

Posted on:

Wednesday 21st November 2012
View Replies!

hide \ if there is an error when submit

hi, i have a form that uses some javascript to have the display text inside of the textarea box disappear when the user clicks inside of it. the problem is that i don't know how to add code in here so that if a user types: I didn't, I can't, You aren't... .... and an error occurs... the text now turns to: I didn\'t, I can\'t, You aren\'t. anyone know how to fix this
VIEWS ON THIS POST

126

Posted on:

Wednesday 21st November 2012
View Replies!

Drop down list value reeturned on submit button being clicked?

I have a drop down selection box with items in it. I need to be able to pass the selected item through using an onclick event for the "Submit" button. Is this possible I have a Javascript that is calling a div to popup. This div is the drop down selector. I want the user to click a button to make the drop down appear, then they must select an item in the list and then hit submit. The submit button being clicked I need to bring in the selected value from the drop down and use it in the script that originally told the div to pop up (this is the first button that the user clicks, it actually runs the script which passes 2 variables, and is basically waiting on the drop down selection to save into a 3rd variable, which will then call a PageMethod). I have function AddTemplateToUUT(uutnumber,testerid){ var templatename=SelectTemplateToAssign(); PageMethods.AddTemplateToUUT(testerid,uutnumber,templatename,CallbackDiv,CallbackErrorAlert,'divchecklistarea'); // ShowSelection('divtemplateblock','hide'); } function SelectTemplateToAssign(){ ShowSelection('divtemplateblock','show'); var tname=document.getElementById('drptemplateselect').value; alert(tname); ShowSelection('divtemplateblock','hide'); return (tname); //PageMethods.AddTemplateToUUT(uutnumber,testerid } Anyone please help This post has been edited by cdietschrun: 24 June 2009 - 01:03 PM
VIEWS ON THIS POST

85

Posted on:

Wednesday 21st November 2012
View Replies!

Trouble with onsubmit

I am trying to get my validate to work with my onsubmit, and if the validator passes then go to the acknowledge page. For some reason it wont validate, I have moved the function all over the code to see if it would work somewhere else. Now the onsubmit isn't also going to acknowledge either. This has been very frustrating since I debug it with firefox and get a function error but I can not find the error. Help please. Customer Demographics Request form /* */ Kudler Fine Foods Customer Demographic Form First Name: Last Name: Address: Email: Phone:
VIEWS ON THIS POST

93

Posted on:

Wednesday 21st November 2012
View Replies!

using javascript to press the submit button

Hi all, I need some help i have an HTML page with a form on it. I simple need a script witch will press the submit button after a while (3 sec for instance)
VIEWS ON THIS POST

86

Posted on:

Wednesday 21st November 2012
View Replies!

Form submits despite return false

Greetings Oh Masters of the JS. Now that you are buttered up, me needeth your help. This is a simple email form validation, with javascript. I first coded the basic 'have you filled in the field" stuff and that worked great, the error message poped up and the form would not submit until corrected. I then put together a email validation function using reg ex, and things went slightly awry. The reg ex works, so that is cool, but after catching an invalid email address, it submits the form anyway. Following the logic, you can see that the form gets validate, then the email address is validated, then the form validation function returns true, which is probably why it is submitting with the bad email address. I never seen an example of this, but can you put a called function into an if statement So it would go: validate the form, then if the email validation function returns true, go ahead and submit. Anyway, here is the code: JS code: function validateForm () { if (document.contactForm.name.value == "") { window.alert ("Please enter your name."); return false; } else if (document.contactForm.email.value == "") { window.alert ("Please enter your email address."); return false; } else if (document.contactForm.phone.value == "") { window.alert ("Please enter a phone number."); return false; } else if (document.contactForm.message.value == "") { window.alert("Please enter a message."); return false; } validateEmail(); return true; } function validateEmail() { var emailPattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/ ; var email = document.contactForm.email.value; if (emailPattern.test(email) == false) { window.alert("Please check your email address."); return false; } } And the onsubmit call in the form: Let me know your suggestions/ideas. Thank you.
VIEWS ON THIS POST

122

Posted on:

Thursday 22nd November 2012
View Replies!

Javascript: submitting external form

all, I was wondering how to do this: Enter values into and submit a form on site B from site A (using Javascript)Load the resulting url into the current site (site A) (using Javascript) I have no idea if this is possible with Javascript, but any help would be much appreciated. If it is not possible with Javascript, what language would I need to do it in
VIEWS ON THIS POST

82

Posted on:

Thursday 22nd November 2012
View Replies!

Javascript: submitting external form

all, I was wondering how to do this: Enter values into and submit a form on site B from site A (using Javascript)Load the resulting url into the current site (site A) (using Javascript) I have no idea if this is possible with Javascript, but any help would be much appreciated. If it is not possible with Javascript, what language would I need to do it in
VIEWS ON THIS POST

99

Posted on:

Thursday 22nd November 2012
View Replies!