473,473 Members | 2,050 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

form submission using javascript

7 New Member
Hi All,

Is there a way of submitting a form using javascript and without manual click on submit button..?
the textbox is being filled dynamically and as soon as it gets a value the form should get submitted. Have anyone tried this before?

It shouldn't be using PHP or ASP or other things.. only HTML and Javascript.

Thanks,
Imtiyaz Quraishi
Mar 22 '11 #1
8 1569
Dormilich
8,658 Recognized Expert Moderator Expert
to submit a form by JavaScript, use the form’s .submit() method. how to trigger that, is a different matter.
Mar 22 '11 #2
imtiyaz quraish
7 New Member
Thanks Niheel for editing and adding wht I forgot..
Thanks Dormilich, but can you let me know what that "Different Matter" could be..?
Mar 22 '11 #3
Dormilich
8,658 Recognized Expert Moderator Expert
that "different matter" is how you call form.submit(). you do not necessarily need a button for that, thus possibilities are numerous.
Mar 22 '11 #4
imtiyaz quraish
7 New Member
A couple of examples of those would be appreciated.. thanks..
Mar 22 '11 #5
Dormilich
8,658 Recognized Expert Moderator Expert
e.g. something as fancy as when a field is filled:
Expand|Select|Wrap|Line Numbers
  1. field_ref.addEventListener("change", form_ref.submit, true);
Mar 22 '11 #6
imtiyaz quraish
7 New Member
Thanks Dormilich but as you might have noticed, from my comments and questions, that I'm a newbie when it comes to javascript. It'll be grateful if you can give me a little detailed example which I can understand or elaborate the above one?
Mar 22 '11 #7
Dormilich
8,658 Recognized Expert Moderator Expert
(actually, when I re-read your OP, my example was quite close).

for some explanation of the code
Expand|Select|Wrap|Line Numbers
  1. field_ref.addEventListener("change", form_ref.submit, true);
field_ref is the JavaScript object of your text field.
change is the event type used (there are some other possible types, but I’ve seen this as the best suited)
form_ref is the is the JavaScript reference to the form element
addEventListener is used for standard event handling (does not work in IE)

for getting the element references (field_ref, form_ref) you typically use document.getElementById()
Mar 22 '11 #8
imtiyaz quraish
7 New Member
Thanks once again, will try this tonight and will let you know.. :)
Mar 22 '11 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Ant | last post by:
Hi, I'm, having some problems with this function. function displayElements() { for (i=0;i<document.forms.elements.length; ++i) { document.writeln(document.forms.elements.value); }
8
by: Adam | last post by:
Hey, I'm using JS to submit a form with image submit buttons, using the following code... (Page is here... http://www.cards2do.co.uk/addcard.php?card_id=292 ) ...
1
by: dvpandya | last post by:
Hi friends thanks in advance i want to check password field value after submiting the form by post method. How can i get that value in html page using javascirpt Example :
5
by: jose1lm | last post by:
What is supposed to happen: A user enters data into one of the FORM input selections. When the user submits the form, the onclick event is supposed to go to a function that will set another FORM...
1
by: skyy | last post by:
Hi, Is there any way to check the status of a form submission using javascript? Check whether the form submission is finished? thanks!
2
by: nbt725 | last post by:
Dear Sir, Hello ! I need to validate my login form which is displayed using <div> to give sliding effect and not to refresh page, hence can't use generic php submit but to validate using...
3
by: cheecs | last post by:
Hi everyone, I'm really stuck in this problem. my problem is Im converting the existing project which is using querystring and I need to change it to POST. At the moment when clicking on submit...
1
by: printline | last post by:
Hello All I'm a newbee to javascript/ajax. I have produced a form, where i want to do some validation on some fields. I have used the spry framework and it works fine. Now, i have a select...
2
by: janu616 | last post by:
Hi all, I am new to this forum.I have started to work with JavaScript. I would like to know how do we pass the form data from one form and display the form values in the next page. And how does...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.