473,324 Members | 2,214 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

getting all the input elements of a form tag

I'm trying to get a list of all the input elements of a form tag and
am having some difficulty doing so. First, here's my XHTML:

<div>
<form action="">
<input type="text" name="a" />
</div>
<div>
<input type="text" name="b" />
</div>
<div>
<input type="submit" />
</form>
</div>

It isn't semantically correct XHTML but that doesn't stop web
developers from coding like that.

Anyway, in both Firefox and IE, if you visit a webpage containing the
above, and hit the Submit button, the resultant URL will have both a
and b defined via GET.

I'd like to be able to get a list of the same input parameters that
the browser does for a given form element. I had been using "//
form[1]//input" as an XPath query, but that doesn't work, here,
because not all of the inputs are children of the form element.

Any ideas?
Jul 16 '08 #1
0 1767

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

Similar topics

3
by: Matt Herson | last post by:
I am looking for a validation script that will only look at the fields in the cgi form, determine if the fields are filled out, then if one or more are blank will write a message at the top of the...
2
by: Marian Aldenhövel | last post by:
Hi, Short question: Is it possible to write a CSS-Style that formats <INPUT TYPE=TEXT>-Elements in Table-Cells in a way that they use all the horizontal space available? Long question: I...
18
by: lawrence | last post by:
If I'm pretty sure there is just one form on the page, can i do this? var myForm = document.forms; If I'm not sure about the form, is it safer to do this? if (document.forms) { var myForm =...
6
by: Dennis Allen | last post by:
Hi. I got a checkbox in a form. When the form is submitted, an email is generated. In the email text is the field name: on or off. The client doesn't want to see on or off, but yes or no. ...
3
by: Ed Jay | last post by:
When I run the below js, I get the error: "document.form1.elements.checked) is null or not an object" <script type="text/javascript"> function get_menu_value(menu_name) { var mValue = 0; ...
10
by: eggie5 | last post by:
Is it possible to get a file without using a form post? I want to get the data (bytes) of a file, text or binary, and just save it to a variable. Similar to the post body of a form that has a...
5
by: laredotornado | last post by:
Hi, I have a number of INPUTs on my page that look like <input id="form_items" name="form_items " size="15" type="text" value="..." /> How do I refer the last one of these on my page? ...
8
omerbutt
by: omerbutt | last post by:
hi there i have a form with multiple input (type/text ) fields and three inputs(type/file) fields i have to submit the form via ajax because i have multiple forms on this page ,you can say it is a...
5
by: yawnmoth | last post by:
I'm trying to get a list of all the input elements of a form tag and am having some difficulty doing so. First, here's my XHTML: <div> <form action=""> <input type="text" name="a" /> </div>...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.