Posting input fields outside of a form

O

Otto Wyss

It's possible to declare inbut fields outside of a form, is it possible
to post these values to the server? E.g. attach them to the posted form?

O. Wyss
 
R

RobG

It's possible to declare inbut fields outside of a form, is it possible
to post these values to the server? E.g. attach them to the posted form?

Possible? Yes, use script to write their values to form controls that
are submitted. But why make submission dependent on scripting?
 
L

-Lost

RobG said:
Possible? Yes, use script to write their values to form controls that
are submitted. But why make submission dependent on scripting?

Or you can retrieve their values, then post them to the server via an XMLHttpRequest.

However, this is not at all appropriate. You would need the entire *valid* form for those
who did not have JavaScript enabled. This allows those who do not have JavaScript enabled
to submit the form. Those who do have JavaScript enabled, well, you get the point.

-Lost
 
R

RobG

Or you can retrieve their values, then post them to the server via an XMLHttpRequest.

That would not be attached "to the posted form", it would be a
separate request and likely to fail in a greater number of browsers
(though how much greater I'm not going to guess :) ).

If the OP's intention is to send the data without posting a form, then
script can be used to append the data to the search string of the URI
for an image, script file, hidden iFrame or page, or any other request
to the server - there is no need to rely on browser support for
XMLHttpRequest.

However, this is not at all appropriate.

ACK.
 
O

Otto Wyss

RobG said:
If the OP's intention is to send the data without posting a form, then
script can be used to append the data to the search string of the URI
for an image, script file, hidden iFrame or page, or any other request
to the server - there is no need to rely on browser support for
XMLHttpRequest.
My intention is to post a form but to attach all the input fields of the
following table with this posted form. Yet I don't want to include the
table into the form because of layout reasons.

O. Wyss
 
R

RobG

My intention is to post a form but to attach all the input fields of the
following table with this posted form. Yet I don't want to include the
table into the form because of layout reasons.

Form is a block element that can have almost anything inside it, I'm
confident you can achieve a good layout using a form for all your
input fields. It may not be what you have now, but it can be just (or
more) functional for users and not subject to the whims of scripting.

If you have layout issues, discuss them in an HTML or CSS group - they
will want a link to a sample page:

news:comp.infosystems.www.authoring.html
<URL: http://groups.google.com.au/group/comp.infosystems.www.authoring.html?lnk=li
news:comp.infosystems.www.authoring.stylesheets
<URL: http://groups.google.com.au/group/comp.infosystems.www.authoring.stylesheets?lnk=li
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top