473,698 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

javascript to iterate thru all TEXT box

Hi,

How to go about iterating thru all the text box in a form?

Any pointers or reference i can read up on?

Thanks

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Dec 11 '06 #1
2 1443
hello,

here is a example that does for a checkbox you can do same for textbox

frmobj=document .forms['profile'];
for(var i=0;i<frmobj.le ngth; i++)
{

if(frmobj.eleme nts[i].type=='checkbo x' &&
document.getEle mentById(frmobj .elements[i].id).checked)
{ // alert(frmobj.el ements[i].onclick);
frmobj.elements[i].onclick.call() ;
}
}
regards,
Amit
On Dec 12, 2:16 am, "User" <user@emailwrot e:
Hi,

How to go about iterating thru all the text box in a form?

Any pointers or reference i can read up on?

Thanks

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Dec 11 '06 #2
User wrote:
How to go about iterating thru all the text box in a form?
for (var i=0; i < document.forms[0].length; ++i) {
if(document.for ms[0].elements[i].type == 'text') {
document.write( document.forms[0].elements[i].name + ' = ')
document.write( document.forms[0].elements[i].value + '<hr>')
}
}

--
Bart

Dec 11 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2187
by: mark | last post by:
Adding an applet to a web page through the <object> tag, allows you to target the JVM in 2 ways. (ref. http://java.sun.com/products/plugin/versions.html ) 1. "Dynamic Versioning", which basically means "run with version X or greater". 2. "Static Versioning", which targets a very specific version, e.g. 1.3.1_06.
2
5354
by: Simon | last post by:
I've got a webform and many controls on it. I would like to iterate thru the control collection to get all the textboxes control to let me change the text property. Here is my code...for unknown reason, this loop iterates only 3 times! Help please! Thanks! Dim Control As Web.UI.Control Dim TextBox As System.Web.UI.WebControls.TextBox For Each Control In Controls If TypeOf (Control) Is System.Web.UI.WebControls.TextBox Then
7
5046
by: Rich | last post by:
Hello, I have a form with 5 textboxes named txt0, txt1, txt2, txt3, tx4. In VB6 I could iterate through these with For i = 0 to 4 debug.print Me.controls("txt" & i).Name Next
1
1462
by: number1.email | last post by:
Hello, I have a simple Web Page Questionairre in which questions are read from a database, and the user can indicate the correct answer via either a radio input control or a dropdown list. The number of questions that is displayed on the screen can vary...depending on the number of questions that satisfy certain criteria. Does anyone have any sample code, or can show me how I can validate this Web Page in JavaScript so that the user is...
5
20004
by: =?iso-8859-1?q?Jean-Fran=E7ois_Michaud?= | last post by:
Hello, I've been trying to figure something out for the past few days and I can't seem to pinpoint what I'm doing wrong. I've been trying to call javascript from inside a <logic:equal>, but it doesn't seem to work like I want. I've tried calling an alert('hello'); to test out if my call worked correctly, and it does, but when I call my own javascript functions
3
1807
by: mike_solomon | last post by:
I am trying to use prototype.js to log javascript errors among other things but by including <script type="text/javascript" src="prototype.js"></scriptin my page some of my existing javascript no longer works for example function submitAction(form,newaction,hiddenName,hiddenValue) {
1
2575
by: KRISHNA PRAVI | last post by:
the error is "runtime error object expected" here is the code....................................................................................... <script language="javascript" src="../Scripts/calender.js"></script> </HEAD> <body bgColor="white" MS_POSITIONING="GridLayout"> <form id="Form1" style="LEFT: 0px; POSITION: absolute; TOP: 0px" method="post" runat="server"> <!--<table width="100%" style="LEFT: 0px; POSITION:...
6
2906
by: john | last post by:
I have the following textbox setup with Text & ToolTip Bindings as follows; I'm using Visual Studio 2008 VB: <asp:TextBox ID="txtDay1" runat="server" Text='<%# Eval("Day1") %>' Width="30px" ToolTip='<%# Eval("M1") %>'></asp:TextBox>
1
1519
by: albies | last post by:
Ciao a tutti, sono nuovo. Ho il problema di recuperare dei campi di struts che si trovano in un iterate indicizzati in una function javascript. questo è il codice del mio iterate: ------------------------------------------------------------------------------------- <% int i = 0; %> <logic:iterate id = "distribuzione" name = "PolivalenzaPdlcPersoneForm" property="listaPlde" type="hse.tpi.vo.PdlcPdlePolivalenzeVO" indexId="ctr"> ...
0
9160
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9029
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8897
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8862
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7729
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6521
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2331
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.