f



form element without forms

   I'm rewriting some AJAX code. Basically this is just tabular data and 
you click on a cell to edit it in place. The cell gets replaced by the 
appropriate form element and an "update" button.

  Now, traditionally I would refer to the form element like this:

document.forms['form_name']['form_element_name']

   Lets say I didn't wish to have a wrapper form (it would increase 
flexibility on what and where I could edit).

   What's the support level on form elements without forms and calling 
them by their id rather than looking in the forms collection?

   Jeff
0
1/1/2009 4:35:22 PM
comp.lang.javascript 38370 articles. 2 followers. javascript4 (1315) is leader. Post Follow

38 Replies
899 Views

Similar Articles

[PageSpeed] 11

Jeff wrote:
>   I'm rewriting some AJAX code. Basically this is just tabular data and 
> you click on a cell to edit it in place. The cell gets replaced by the 
> appropriate form element and an "update" button.

>   What's the support level on form elements without forms and calling 
> them by their id rather than looking in the forms collection?

Well document.getElementById is certainly supported in browsers that 
allow you to replace the cell contents with a form control like an input 
control.

-- 

	Martin Honnen
	http://JavaScript.FAQTs.com/
0
Martin
1/1/2009 5:14:07 PM
Jeff wrote:
>   I'm rewriting some AJAX code. Basically this is just tabular data and 
> you click on a cell to edit it in place. The cell gets replaced by the 
> appropriate form element and an "update" button.
> 
>  Now, traditionally I would refer to the form element like this:
> 
> document.forms['form_name']['form_element_name']
> 
>   Lets say I didn't wish to have a wrapper form (it would increase 
> flexibility on what and where I could edit).
> 
>   What's the support level on form elements without forms and calling 
> them by their id rather than looking in the forms collection?
> 
>   Jeff

How are you going to submit the element without a form?

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
0
Jerry
1/1/2009 7:22:19 PM
Jerry Stuckle wrote:
> Jeff wrote:
>>   I'm rewriting some AJAX code. Basically this is just tabular data 
>> and you click on a cell to edit it in place. The cell gets replaced by 
>> the appropriate form element and an "update" button.
>>
>>  Now, traditionally I would refer to the form element like this:
>>
>> document.forms['form_name']['form_element_name']
>>
>>   Lets say I didn't wish to have a wrapper form (it would increase 
>> flexibility on what and where I could edit).
>>
>>   What's the support level on form elements without forms and calling 
>> them by their id rather than looking in the forms collection?
>>
>>   Jeff
> 
> How are you going to submit the element without a form?
> 

How about with something like

<input type="button" value="Enter" onclick ="function()"/>

for buttons and

var a = (document.getElementById("element1").value or

for text boxes?

Steve.
0
SteveYoungTbird
1/1/2009 9:00:15 PM
SteveYoungTbird wrote:
> Jerry Stuckle wrote:
>> Jeff wrote:
>>>   I'm rewriting some AJAX code. Basically this is just tabular data 
>>> and you click on a cell to edit it in place. The cell gets replaced 
>>> by the appropriate form element and an "update" button.
>>>
>>>  Now, traditionally I would refer to the form element like this:
>>>
>>> document.forms['form_name']['form_element_name']
>>>
>>>   Lets say I didn't wish to have a wrapper form (it would increase 
>>> flexibility on what and where I could edit).
>>>
>>>   What's the support level on form elements without forms and calling 
>>> them by their id rather than looking in the forms collection?
>>>
>>>   Jeff
>>
>> How are you going to submit the element without a form?
>>
> 
> How about with something like
> 
> <input type="button" value="Enter" onclick ="function()"/>
> 
> for buttons and
> 
> var a = (document.getElementById("element1").value or
> 
> for text boxes?
> 
> Steve.

And exactly how does that submit the element?

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
0
Jerry
1/1/2009 9:31:15 PM
Jerry Stuckle wrote:
> SteveYoungTbird wrote:
>> Jerry Stuckle wrote:
>>> Jeff wrote:
>>>>   I'm rewriting some AJAX code. Basically this is just tabular data 
>>>> and you click on a cell to edit it in place. The cell gets replaced 
>>>> by the appropriate form element and an "update" button.
>>>>
>>>>  Now, traditionally I would refer to the form element like this:
>>>>
>>>> document.forms['form_name']['form_element_name']
>>>>
>>>>   Lets say I didn't wish to have a wrapper form (it would increase 
>>>> flexibility on what and where I could edit).
>>>>
>>>>   What's the support level on form elements without forms and 
>>>> calling them by their id rather than looking in the forms collection?
>>>>
>>>>   Jeff
>>>
>>> How are you going to submit the element without a form?
>>>
>>
>> How about with something like
>>
>> <input type="button" value="Enter" onclick ="function()"/>
>>
>> for buttons and
>>
>> var a = (document.getElementById("element1").value or
>>
>> for text boxes?
>>
>> Steve.
> 
> And exactly how does that submit the element?

   In the background through AJAX, the form itself never gets submitted, 
hence no need for either a submit or a form.

   Jeff


> 
0
Jeff
1/2/2009 2:54:08 AM
Jeff wrote:
> Jerry Stuckle wrote:
>> SteveYoungTbird wrote:
>>> Jerry Stuckle wrote:
>>>> Jeff wrote:
>>>>>   I'm rewriting some AJAX code. Basically this is just tabular data 
>>>>> and you click on a cell to edit it in place. The cell gets replaced 
>>>>> by the appropriate form element and an "update" button.
>>>>>
>>>>>  Now, traditionally I would refer to the form element like this:
>>>>>
>>>>> document.forms['form_name']['form_element_name']
>>>>>
>>>>>   Lets say I didn't wish to have a wrapper form (it would increase 
>>>>> flexibility on what and where I could edit).
>>>>>
>>>>>   What's the support level on form elements without forms and 
>>>>> calling them by their id rather than looking in the forms collection?
>>>>>
>>>>>   Jeff
>>>>
>>>> How are you going to submit the element without a form?
>>>>
>>>
>>> How about with something like
>>>
>>> <input type="button" value="Enter" onclick ="function()"/>
>>>
>>> for buttons and
>>>
>>> var a = (document.getElementById("element1").value or
>>>
>>> for text boxes?
>>>
>>> Steve.
>>
>> And exactly how does that submit the element?
> 
>   In the background through AJAX, the form itself never gets submitted, 
> hence no need for either a submit or a form.
> 
>   Jeff
> 
> 
>>

That's not the code shown.  And the form never gets submitted, because 
there is no form to submit.

Again, how is the element going to get submitted?


-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
0
Jerry
1/2/2009 3:01:21 AM
Jerry Stuckle wrote:
> Jeff wrote:
>> Jerry Stuckle wrote:
>>> SteveYoungTbird wrote:
>>>> Jerry Stuckle wrote:
>>>>> Jeff wrote:
>>>>>>   I'm rewriting some AJAX code. Basically this is just tabular 
>>>>>> data and you click on a cell to edit it in place. The cell gets 
>>>>>> replaced by the appropriate form element and an "update" button.
>>>>>>
>>>>>>  Now, traditionally I would refer to the form element like this:
>>>>>>
>>>>>> document.forms['form_name']['form_element_name']
>>>>>>
>>>>>>   Lets say I didn't wish to have a wrapper form (it would increase 
>>>>>> flexibility on what and where I could edit).
>>>>>>
>>>>>>   What's the support level on form elements without forms and 
>>>>>> calling them by their id rather than looking in the forms collection?
>>>>>>
>>>>>>   Jeff
>>>>>
>>>>> How are you going to submit the element without a form?
>>>>>
>>>>
>>>> How about with something like
>>>>
>>>> <input type="button" value="Enter" onclick ="function()"/>
>>>>
>>>> for buttons and
>>>>
>>>> var a = (document.getElementById("element1").value or
>>>>
>>>> for text boxes?
>>>>
>>>> Steve.
>>>
>>> And exactly how does that submit the element?
>>
>>   In the background through AJAX, the form itself never gets 
>> submitted, hence no need for either a submit or a form.
>>
>>   Jeff
>>
>>
>>>
> 
> That's not the code shown.  And the form never gets submitted, because 
> there is no form to submit.
> 
> Again, how is the element going to get submitted?

I think you are making to much of this. All we are doing is updating one 
cell in a database table. Just use javascript to grab the form element 
value, build an ajax request and send it off to the server (where it 
updates that cell) and optionally read the ajax response.


  I believe GOOGLE does the same thing when you type into their search 
field and a list of search suggestions pops up.

   Now, I've noticed that you no longer need a form for a form field to 
be visible, it didn't used to be that way.

Run this:

<input type="text" id="a" value="test">
<script type="text/javascript">
alert(document.getElementById('a').value);
</script>

Works for me in IE6 and Firefox 3.05, Safari 3.2.1 This appears to be 
widespread.

I have a very narrow audience of site administrators that will need to 
update tabular data, just a field here and there.

   My question was, can I toss the form and just address by ID and 
expect this to work in the usual mass market browsers. The answer 
appears to be yes. Now, I wouldn't have thought of doing this a few 
years ago, but times change and perhaps I need to change.

   Lets say I have a page with tables I wish to update, and in the 
middle of that a form that may need to get submitted conventionally 
(perhaps a file). Since you can't nest forms and if you have many tables 
you would need many forms (and a different reference for each), it makes 
sense to get rid of forms that will never be submitted. Like I said, I'm 
revising my code for ajax editable tables and wanted some advice.

   Lets say you have a table with 10 columns and 50 rows. It would be 
crazy to fill that with 500 assorted form fields and send that off to 
the server. There's every likelihood the browser couldn't render 500 
form fields let alone fit it on a page without horizontal scrollbars. 
Traditionally you would edit that one row at a time and you would 
(visually) lose your place in the table afterwards. Surely I'm not the 
only one using ajax to edit masses of data?

   Jeff
> 
> 
0
Jeff
1/2/2009 5:23:19 AM
Martin Honnen wrote:
> Jeff wrote:
>>   I'm rewriting some AJAX code. Basically this is just tabular data 
>> and you click on a cell to edit it in place. The cell gets replaced by 
>> the appropriate form element and an "update" button.
> 
>>   What's the support level on form elements without forms and calling 
>> them by their id rather than looking in the forms collection?
> 
> Well document.getElementById is certainly supported in browsers that 
> allow you to replace the cell contents with a form control like an input 
> control.
> 

   Good to see you around and thanks!

  I've noticed that Germans are top notch programmers. Since I'm only 
half German this may be why I'm only half as good!

   Jeff
0
Jeff
1/2/2009 5:30:30 AM
Jeff wrote:
<snip>
> 
>   My question was, can I toss the form and just address by ID and expect 
> this to work in the usual mass market browsers. The answer appears to be 
> yes. Now, I wouldn't have thought of doing this a few years ago, but 
> times change and perhaps I need to change.
> 
>   Lets say I have a page with tables I wish to update, and in the middle 
> of that a form that may need to get submitted conventionally (perhaps a 
> file). Since you can't nest forms and if you have many tables you would 
> need many forms (and a different reference for each), it makes sense to 
> get rid of forms that will never be submitted. Like I said, I'm revising 
> my code for ajax editable tables and wanted some advice.
> 
>   Lets say you have a table with 10 columns and 50 rows. It would be 
> crazy to fill that with 500 assorted form fields and send that off to 
> the server. There's every likelihood the browser couldn't render 500 
> form fields let alone fit it on a page without horizontal scrollbars. 
> Traditionally you would edit that one row at a time and you would 
> (visually) lose your place in the table afterwards. Surely I'm not the 
> only one using ajax to edit masses of data?

I am working on something similar, but am contemplating keeping the form 
elements with no submit buttons, just generic buttons.  The User can 
update a single field by double clicking after editing, or several 
fields by clicking the appropriate button.  One reason for keeping the 
form elements are they provide a convenient container, and when named to 
correspond to the database table of the fields they contain, they 
provide additional information to Ajax.  for example:

// in the HTML
<input name="Name" type="text" onChange"fieldChanged(this)" 
onDblClick="updateViaAjax(this)" >

// in the JS
function fieldChanged(caller){
    caller.className = "dirty" ;/* CSS class to provide user visual 
indication data on the screen is out of sync with the db*/
    // do anything else you need
}
function updateViaAjax(caller){
    dbtableName=caller.form.name;
    //do some Ajax stuff here
    caller.className = "" ;/* (or set to a defined CSS class) indicating 
data is back in sync*/
}

You may want to do something with onSubmit it catch when the user hits 
"enter" from within a form, and you could loop through 
caller.form.elements looking for objects with className=="dirty" to find 
fields in need of updating.  So the "forms" are not completely useless.

Just some food for thought.
0
William
1/2/2009 7:58:30 AM
Jeff wrote:
> Jerry Stuckle wrote:
>> Jeff wrote:
>>> Jerry Stuckle wrote:
>>>> SteveYoungTbird wrote:
>>>>> Jerry Stuckle wrote:
>>>>>> Jeff wrote:
>>>>>>>   I'm rewriting some AJAX code. Basically this is just tabular 
>>>>>>> data and you click on a cell to edit it in place. The cell gets 
>>>>>>> replaced by the appropriate form element and an "update" button.
>>>>>>>
>>>>>>>  Now, traditionally I would refer to the form element like this:
>>>>>>>
>>>>>>> document.forms['form_name']['form_element_name']
>>>>>>>
>>>>>>>   Lets say I didn't wish to have a wrapper form (it would 
>>>>>>> increase flexibility on what and where I could edit).
>>>>>>>
>>>>>>>   What's the support level on form elements without forms and 
>>>>>>> calling them by their id rather than looking in the forms 
>>>>>>> collection?
>>>>>>>
>>>>>>>   Jeff
>>>>>>
>>>>>> How are you going to submit the element without a form?
>>>>>>
>>>>>
>>>>> How about with something like
>>>>>
>>>>> <input type="button" value="Enter" onclick ="function()"/>
>>>>>
>>>>> for buttons and
>>>>>
>>>>> var a = (document.getElementById("element1").value or
>>>>>
>>>>> for text boxes?
>>>>>
>>>>> Steve.
>>>>
>>>> And exactly how does that submit the element?
>>>
>>>   In the background through AJAX, the form itself never gets 
>>> submitted, hence no need for either a submit or a form.
>>>
>>>   Jeff
>>>
>>>
>>>>
>>
>> That's not the code shown.  And the form never gets submitted, because 
>> there is no form to submit.
>>
>> Again, how is the element going to get submitted?
> 
> I think you are making to much of this. All we are doing is updating one 
> cell in a database table. Just use javascript to grab the form element 
> value, build an ajax request and send it off to the server (where it 
> updates that cell) and optionally read the ajax response.
> 
> 
>  I believe GOOGLE does the same thing when you type into their search 
> field and a list of search suggestions pops up.
> 
>   Now, I've noticed that you no longer need a form for a form field to 
> be visible, it didn't used to be that way.
> 
> Run this:
> 
> <input type="text" id="a" value="test">
> <script type="text/javascript">
> alert(document.getElementById('a').value);
> </script>
> 
> Works for me in IE6 and Firefox 3.05, Safari 3.2.1 This appears to be 
> widespread.
> 
> I have a very narrow audience of site administrators that will need to 
> update tabular data, just a field here and there.
> 
>   My question was, can I toss the form and just address by ID and expect 
> this to work in the usual mass market browsers. The answer appears to be 
> yes. Now, I wouldn't have thought of doing this a few years ago, but 
> times change and perhaps I need to change.
> 
>   Lets say I have a page with tables I wish to update, and in the middle 
> of that a form that may need to get submitted conventionally (perhaps a 
> file). Since you can't nest forms and if you have many tables you would 
> need many forms (and a different reference for each), it makes sense to 
> get rid of forms that will never be submitted. Like I said, I'm revising 
> my code for ajax editable tables and wanted some advice.
> 
>   Lets say you have a table with 10 columns and 50 rows. It would be 
> crazy to fill that with 500 assorted form fields and send that off to 
> the server. There's every likelihood the browser couldn't render 500 
> form fields let alone fit it on a page without horizontal scrollbars. 
> Traditionally you would edit that one row at a time and you would 
> (visually) lose your place in the table afterwards. Surely I'm not the 
> only one using ajax to edit masses of data?
> 
>   Jeff
>>
>>

No, I'm not.  It's a simple question.  Without a form, how are you going 
to submit the element to the server?

Editing on the client is all well and good.  But it's useless until it 
gets to the server.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
0
Jerry
1/2/2009 11:11:26 AM
On 2009-01-02 06:23, Jeff wrote:
> My question was, can I toss the form and just address by ID and 
> expect this to work in the usual mass market browsers. The answer 
> appears to be yes. Now, I wouldn't have thought of doing this a few 
> years ago, but times change and perhaps I need to change.

Quick reply: form elements are not required in either HTML 4.01, XHTML,
or HTML 5. You can let the HTML validator at validator.w3.org check your
document to confirm this. I think that was true even for earlier HTML
versions, but I'm too lazy to look it up right now :-)


  - Conrad


f'up a.w.webmaster
0
Conrad
1/2/2009 11:26:41 AM
William Gill wrote:
> Jeff wrote:
> <snip>
>>
>>   My question was, can I toss the form and just address by ID and 
>> expect this to work in the usual mass market browsers. The answer 
>> appears to be yes. Now, I wouldn't have thought of doing this a few 
>> years ago, but times change and perhaps I need to change.
>>
>>   Lets say I have a page with tables I wish to update, and in the 
>> middle of that a form that may need to get submitted conventionally 
>> (perhaps a file). Since you can't nest forms and if you have many 
>> tables you would need many forms (and a different reference for each), 
>> it makes sense to get rid of forms that will never be submitted. Like 
>> I said, I'm revising my code for ajax editable tables and wanted some 
>> advice.
>>
>>   Lets say you have a table with 10 columns and 50 rows. It would be 
>> crazy to fill that with 500 assorted form fields and send that off to 
>> the server. There's every likelihood the browser couldn't render 500 
>> form fields let alone fit it on a page without horizontal scrollbars. 
>> Traditionally you would edit that one row at a time and you would 
>> (visually) lose your place in the table afterwards. Surely I'm not the 
>> only one using ajax to edit masses of data?
> 
> I am working on something similar, but am contemplating keeping the form 
> elements with no submit buttons, just generic buttons.  The User can 
> update a single field by double clicking after editing, or several 
> fields by clicking the appropriate button.  One reason for keeping the 
> form elements are they provide a convenient container, and when named to 
> correspond to the database table of the fields they contain, they 
> provide additional information to Ajax.  for example:
> 
> // in the HTML
> <input name="Name" type="text" onChange"fieldChanged(this)" 
> onDblClick="updateViaAjax(this)" >


The ondoubleclick update is great! Having a button takes up real estate 
and that doesn't.

   Just a word on how I'm doing this. I'm IDing the rows with the 
primary key, IDing the table with the table name and using a class to 
set the cell the cell. That way you don't have to embed this info in the 
input name.


   Jeff

> 
> // in the JS
> function fieldChanged(caller){
>    caller.className = "dirty" ;/* CSS class to provide user visual 
> indication data on the screen is out of sync with the db*/
>    // do anything else you need
> }
> function updateViaAjax(caller){
>    dbtableName=caller.form.name;
>    //do some Ajax stuff here
>    caller.className = "" ;/* (or set to a defined CSS class) indicating 
> data is back in sync*/
> }
> 
> You may want to do something with onSubmit it catch when the user hits 
> "enter" from within a form, and you could loop through 
> caller.form.elements looking for objects with className=="dirty" to find 
> fields in need of updating.  So the "forms" are not completely useless.
> 
> Just some food for thought.
0
Jeff
1/2/2009 2:20:58 PM
Jerry Stuckle wrote:
> Jeff wrote:
>> Jerry Stuckle wrote:
>>> Jeff wrote:
>>>> Jerry Stuckle wrote:
>>>>> SteveYoungTbird wrote:
>>>>>> Jerry Stuckle wrote:
>>>>>>> Jeff wrote:
>>>>>>>>   I'm rewriting some AJAX code. Basically this is just tabular 
>>>>>>>> data and you click on a cell to edit it in place. The cell gets 
>>>>>>>> replaced by the appropriate form element and an "update" button.
>>>>>>>>
>>>>>>>>  Now, traditionally I would refer to the form element like this:
>>>>>>>>
>>>>>>>> document.forms['form_name']['form_element_name']
>>>>>>>>
>>>>>>>>   Lets say I didn't wish to have a wrapper form (it would 
>>>>>>>> increase flexibility on what and where I could edit).
>>>>>>>>
>>>>>>>>   What's the support level on form elements without forms and 
>>>>>>>> calling them by their id rather than looking in the forms 
>>>>>>>> collection?
>>>>>>>>
>>>>>>>>   Jeff
>>>>>>>
>>>>>>> How are you going to submit the element without a form?
>>>>>>>
>>>>>>
>>>>>> How about with something like
>>>>>>
>>>>>> <input type="button" value="Enter" onclick ="function()"/>
>>>>>>
>>>>>> for buttons and
>>>>>>
>>>>>> var a = (document.getElementById("element1").value or
>>>>>>
>>>>>> for text boxes?
>>>>>>
>>>>>> Steve.
>>>>>
>>>>> And exactly how does that submit the element?
>>>>
>>>>   In the background through AJAX, the form itself never gets 
>>>> submitted, hence no need for either a submit or a form.
>>>>
>>>>   Jeff
>>>>
>>>>
>>>>>
>>>
>>> That's not the code shown.  And the form never gets submitted, 
>>> because there is no form to submit.
>>>
>>> Again, how is the element going to get submitted?
>>
>> I think you are making to much of this. All we are doing is updating 
>> one cell in a database table. Just use javascript to grab the form 
>> element value, build an ajax request and send it off to the server 
>> (where it updates that cell) and optionally read the ajax response.
>>
>>
>>  I believe GOOGLE does the same thing when you type into their search 
>> field and a list of search suggestions pops up.
>>
>>   Now, I've noticed that you no longer need a form for a form field to 
>> be visible, it didn't used to be that way.
>>
>> Run this:
>>
>> <input type="text" id="a" value="test">
>> <script type="text/javascript">
>> alert(document.getElementById('a').value);
>> </script>
>>
>> Works for me in IE6 and Firefox 3.05, Safari 3.2.1 This appears to be 
>> widespread.
>>
>> I have a very narrow audience of site administrators that will need to 
>> update tabular data, just a field here and there.
>>
>>   My question was, can I toss the form and just address by ID and 
>> expect this to work in the usual mass market browsers. The answer 
>> appears to be yes. Now, I wouldn't have thought of doing this a few 
>> years ago, but times change and perhaps I need to change.
>>
>>   Lets say I have a page with tables I wish to update, and in the 
>> middle of that a form that may need to get submitted conventionally 
>> (perhaps a file). Since you can't nest forms and if you have many 
>> tables you would need many forms (and a different reference for each), 
>> it makes sense to get rid of forms that will never be submitted. Like 
>> I said, I'm revising my code for ajax editable tables and wanted some 
>> advice.
>>
>>   Lets say you have a table with 10 columns and 50 rows. It would be 
>> crazy to fill that with 500 assorted form fields and send that off to 
>> the server. There's every likelihood the browser couldn't render 500 
>> form fields let alone fit it on a page without horizontal scrollbars. 
>> Traditionally you would edit that one row at a time and you would 
>> (visually) lose your place in the table afterwards. Surely I'm not the 
>> only one using ajax to edit masses of data?
>>
>>   Jeff
>>>
>>>
> 
> No, I'm not.  It's a simple question.  Without a form, how are you going 
> to submit the element to the server?
> 
> Editing on the client is all well and good.  But it's useless until it 
> gets to the server.

   Jerry, AJAX sends the form value to the server. That is what ajax 
does, javascript talking asynchronously to the server.

   Jeff
> 
0
Jeff
1/2/2009 2:24:06 PM
Jeff wrote:
> 
> ...Having a button takes up real estate 
> and that doesn't.
> 
Not sure I follow, but it doesn't have to be a button.  Any element that 
responds to a click would work (<a name="thisGroup" 
onDblClick="update(this)">[doit]</a>), but finding and collecting all 
the related fields with className="dirty" may not be as straight forward.

>   Just a word on how I'm doing this. I'm IDing the rows with the primary 
> key, IDing the table with the table name and using a class to set the 
> cell the cell. That way you don't have to embed this info in the input 
> name.

Theory is similar.  IMHO people don't always want to update each field 
as they edit them, so I try to establish logical collections that make 
sense to update in groups.  Single field updates are a snap by passing 
the self reference, but it gets more complicated using a "remote 
control" that has to tell the function, don't update me, update my 
friends.  The DOM parentNode may work.


0
William
1/2/2009 5:22:32 PM
Jerry Stuckle wrote:

> No, I'm not.  It's a simple question.  Without a form, how are you going 
> to submit the element to the server?
> 
Jerry,
per
The XMLHttpRequest Object W3C
Working Draft 15 April 2008
http://www.w3.org/TR/XMLHttpRequest/

"The XMLHttpRequest Object specification defines an API that provides 
scripted client functionality for transferring data between a client and 
a server. "
0
William
1/2/2009 5:55:52 PM
Jerry Stuckle wrote:
> Jeff wrote:
>> Jerry Stuckle wrote:
>>> Jeff wrote:
>>>> Jerry Stuckle wrote:
>>>>> SteveYoungTbird wrote:
>>>>>> Jerry Stuckle wrote:
>>>>>>> How are you going to submit the element without a form?
>>>>>> How about with something like
>>>>>>
>>>>>> <input type="button" value="Enter" onclick ="function()"/>
>>>>>>
>>>>>> for buttons and
>>>>>>
>>>>>> var a = (document.getElementById("element1").value or
>>>>>>
>>>>>> for text boxes?
>>>>>>
>>>>>> Steve.
>>>>> And exactly how does that submit the element?
>>>>   In the background through AJAX, the form itself never gets 
>>>> submitted, hence no need for either a submit or a form.
>>>> [...]
>>> That's not the code shown.  And the form never gets submitted, because 
>>> there is no form to submit.
>>>
>>> Again, how is the element going to get submitted?
>> I think you are making to much of this. 
>> [snipped 100+ lines]
> 
> No, I'm not.  It's a simple question.

Which, in order to reiterate it although being answered already, took you
138 lines for your readers to download.  Please stay in alt.www.* where
lusers like you belong.


Score adjusted

PointedEars, F'up2 set
0
Thomas
1/2/2009 10:23:14 PM
William Gill wrote:
> Jerry Stuckle wrote:
> 
>> No, I'm not.  It's a simple question.  Without a form, how are you 
>> going to submit the element to the server?
>>
> Jerry,
> per
> The XMLHttpRequest Object W3C
> Working Draft 15 April 2008
> http://www.w3.org/TR/XMLHttpRequest/
> 
> "The XMLHttpRequest Object specification defines an API that provides 
> scripted client functionality for transferring data between a client and 
> a server. "

Which doesn't answer my question.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
0
Jerry
1/2/2009 10:29:45 PM
Jeff wrote:
> Jerry Stuckle wrote:
>> Jeff wrote:
>>> Jerry Stuckle wrote:
>>>> Jeff wrote:
>>>>> Jerry Stuckle wrote:
>>>>>> SteveYoungTbird wrote:
>>>>>>> Jerry Stuckle wrote:
>>>>>>>> Jeff wrote:
>>>>>>>>>   I'm rewriting some AJAX code. Basically this is just tabular 
>>>>>>>>> data and you click on a cell to edit it in place. The cell gets 
>>>>>>>>> replaced by the appropriate form element and an "update" button.
>>>>>>>>>
>>>>>>>>>  Now, traditionally I would refer to the form element like this:
>>>>>>>>>
>>>>>>>>> document.forms['form_name']['form_element_name']
>>>>>>>>>
>>>>>>>>>   Lets say I didn't wish to have a wrapper form (it would 
>>>>>>>>> increase flexibility on what and where I could edit).
>>>>>>>>>
>>>>>>>>>   What's the support level on form elements without forms and 
>>>>>>>>> calling them by their id rather than looking in the forms 
>>>>>>>>> collection?
>>>>>>>>>
>>>>>>>>>   Jeff
>>>>>>>>
>>>>>>>> How are you going to submit the element without a form?
>>>>>>>>
>>>>>>>
>>>>>>> How about with something like
>>>>>>>
>>>>>>> <input type="button" value="Enter" onclick ="function()"/>
>>>>>>>
>>>>>>> for buttons and
>>>>>>>
>>>>>>> var a = (document.getElementById("element1").value or
>>>>>>>
>>>>>>> for text boxes?
>>>>>>>
>>>>>>> Steve.
>>>>>>
>>>>>> And exactly how does that submit the element?
>>>>>
>>>>>   In the background through AJAX, the form itself never gets 
>>>>> submitted, hence no need for either a submit or a form.
>>>>>
>>>>>   Jeff
>>>>>
>>>>>
>>>>>>
>>>>
>>>> That's not the code shown.  And the form never gets submitted, 
>>>> because there is no form to submit.
>>>>
>>>> Again, how is the element going to get submitted?
>>>
>>> I think you are making to much of this. All we are doing is updating 
>>> one cell in a database table. Just use javascript to grab the form 
>>> element value, build an ajax request and send it off to the server 
>>> (where it updates that cell) and optionally read the ajax response.
>>>
>>>
>>>  I believe GOOGLE does the same thing when you type into their search 
>>> field and a list of search suggestions pops up.
>>>
>>>   Now, I've noticed that you no longer need a form for a form field 
>>> to be visible, it didn't used to be that way.
>>>
>>> Run this:
>>>
>>> <input type="text" id="a" value="test">
>>> <script type="text/javascript">
>>> alert(document.getElementById('a').value);
>>> </script>
>>>
>>> Works for me in IE6 and Firefox 3.05, Safari 3.2.1 This appears to be 
>>> widespread.
>>>
>>> I have a very narrow audience of site administrators that will need 
>>> to update tabular data, just a field here and there.
>>>
>>>   My question was, can I toss the form and just address by ID and 
>>> expect this to work in the usual mass market browsers. The answer 
>>> appears to be yes. Now, I wouldn't have thought of doing this a few 
>>> years ago, but times change and perhaps I need to change.
>>>
>>>   Lets say I have a page with tables I wish to update, and in the 
>>> middle of that a form that may need to get submitted conventionally 
>>> (perhaps a file). Since you can't nest forms and if you have many 
>>> tables you would need many forms (and a different reference for 
>>> each), it makes sense to get rid of forms that will never be 
>>> submitted. Like I said, I'm revising my code for ajax editable tables 
>>> and wanted some advice.
>>>
>>>   Lets say you have a table with 10 columns and 50 rows. It would be 
>>> crazy to fill that with 500 assorted form fields and send that off to 
>>> the server. There's every likelihood the browser couldn't render 500 
>>> form fields let alone fit it on a page without horizontal scrollbars. 
>>> Traditionally you would edit that one row at a time and you would 
>>> (visually) lose your place in the table afterwards. Surely I'm not 
>>> the only one using ajax to edit masses of data?
>>>
>>>   Jeff
>>>>
>>>>
>>
>> No, I'm not.  It's a simple question.  Without a form, how are you 
>> going to submit the element to the server?
>>
>> Editing on the client is all well and good.  But it's useless until it 
>> gets to the server.
> 
>   Jerry, AJAX sends the form value to the server. That is what ajax 
> does, javascript talking asynchronously to the server.
> 
>   Jeff
>>

PLEASE READ THE QUESTION!  He wants to do it WITHOUT A FORM.

Now please tell me how he is going to submit the changes WITHOUT A FORM.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
0
Jerry
1/2/2009 10:30:27 PM
On 2009-01-02 23:30, Jerry Stuckle wrote:
> Jeff wrote:
>>   Jerry, AJAX sends the form value to the server. That is what ajax 
>> does, javascript talking asynchronously to the server.
> 
> PLEASE READ THE QUESTION!  He wants to do it WITHOUT A FORM.
> 
> Now please tell me how he is going to submit the changes WITHOUT A FORM.

Please read the replies, and don't shout. Look up AJAX or XMLHttpRequest
in a reference of your choice and you will see how data can be sent to
the server without forms. There's also quite a number of other ways to
accomplish that, so please keep the noise down and inform yourself.


  - Conrad

f'up a.w.webmaster
0
Conrad
1/2/2009 10:56:06 PM
Jerry Stuckle wrote:
> William Gill wrote:
>> Jerry Stuckle wrote:
>>
>>> No, I'm not.  It's a simple question.  Without a form, how are you 
>>> going to submit the element to the server?
>>>
>> Jerry,
>> per
>> The XMLHttpRequest Object W3C
>> Working Draft 15 April 2008
>> http://www.w3.org/TR/XMLHttpRequest/
>>
>> "The XMLHttpRequest Object specification defines an API that provides 
>> scripted client functionality for transferring data between a client 
>> and a server. "
> 
> Which doesn't answer my question.
> 
Yes it does.  Ajax employs the XMLHttpRequest Object to exchange data 
with the server without having to reload the page as happens in a 
conventional form/submit transaction.  Ajax allows JS to send the data 
contained in the element's value attribute (or any other data), receive 
a reply, and if desired update the page.  So the simple answer is he 
won't "submit" anything.  He will pass the data to the server via 
another mechanism in HTTP using established GET or POST methods.  The 
data still gets to the server without a form.


0
William
1/2/2009 11:12:07 PM
On Jan 2, 10:30 pm, Jerry Stuckle wrote:
> PLEASE READ THE QUESTION!  He wants to do it WITHOUT A FORM.
>
> Now please tell me how he is going to submit the changes WITHOUT A FORM.

AJAX does not really need a form, it needs an element id to find the
element in the DOM tree of the page,
an event listener, and a JavaScript function to specify what to do
with the content of that element and
to contact the server when it captures the event, etc......

The difficulties are the usual things associated with JavaScript, it
is difficult to make it work in
all browsers, and of course it does not work in browsers with
JavaScript disabled or
in browsers that do not support JavaScript.
0
mynameisnobodyodysse
1/3/2009 12:49:35 AM
mynameisnobodyodyssea@googlemail.com wrote:
> On Jan 2, 10:30 pm, Jerry Stuckle wrote:
>> Now please tell me how he is going to submit the changes WITHOUT A FORM.
> 
> AJAX does not really need a form, it needs an element id [...]

It does not need even that.

  var x = new XMLHttpRequest();
  x.open("GET", "?foo=bar", true);
  x.send(null);


F'up2 comp.lang.javascript

PointedEars
0
Thomas
1/3/2009 1:04:30 AM
mynameisnobodyodyssea@googlemail.com wrote:
> On Jan 2, 10:30 pm, Jerry Stuckle wrote:
>> PLEASE READ THE QUESTION!  He wants to do it WITHOUT A FORM.
>>
>> Now please tell me how he is going to submit the changes WITHOUT A FORM.
> 
> AJAX does not really need a form, it needs an element id to find the
> element in the DOM tree of the page,
> an event listener, and a JavaScript function to specify what to do
> with the content of that element and
> to contact the server when it captures the event, etc......
> 
> The difficulties are the usual things associated with JavaScript, it
> is difficult to make it work in
> all browsers, and of course it does not work in browsers with
> JavaScript disabled or
> in browsers that do not support JavaScript.

That's fine - and it FINALLY answers my question (I don't use AJAX, 
obviously).

Until now, EVERY answer was related to submitting forms using AJAX or 
similar.

Thanks for the clarification.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
0
Jerry
1/3/2009 1:20:50 AM
Conrad Lender wrote:
> On 2009-01-02 23:30, Jerry Stuckle wrote:
>> Jeff wrote:
>>>   Jerry, AJAX sends the form value to the server. That is what ajax 
>>> does, javascript talking asynchronously to the server.
>> PLEASE READ THE QUESTION!  He wants to do it WITHOUT A FORM.
>>
>> Now please tell me how he is going to submit the changes WITHOUT A FORM.
> 
> Please read the replies, and don't shout. Look up AJAX or XMLHttpRequest
> in a reference of your choice and you will see how data can be sent to
> the server without forms. There's also quite a number of other ways to
> accomplish that, so please keep the noise down and inform yourself.
> 
> 
>   - Conrad
> 
> f'up a.w.webmaster


I DID read the replies, but obviously YOU didn't.  EVERY REPLY talked 
about SUBMITTING A FORM.

And I was trying to inform myself.  But it seems no one was reading my 
question until I did yell!

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
0
Jerry
1/3/2009 1:22:32 AM
Thomas 'PointedEars' Lahn wrote:
> Jerry Stuckle wrote:
>> Jeff wrote:
>>> Jerry Stuckle wrote:
>>>> Jeff wrote:
>>>>> Jerry Stuckle wrote:
>>>>>> SteveYoungTbird wrote:
>>>>>>> Jerry Stuckle wrote:
>>>>>>>> How are you going to submit the element without a form?
>>>>>>> How about with something like
>>>>>>>
>>>>>>> <input type="button" value="Enter" onclick ="function()"/>
>>>>>>>
>>>>>>> for buttons and
>>>>>>>
>>>>>>> var a = (document.getElementById("element1").value or
>>>>>>>
>>>>>>> for text boxes?
>>>>>>>
>>>>>>> Steve.
>>>>>> And exactly how does that submit the element?
>>>>>   In the background through AJAX, the form itself never gets 
>>>>> submitted, hence no need for either a submit or a form.
>>>>> [...]
>>>> That's not the code shown.  And the form never gets submitted, because 
>>>> there is no form to submit.
>>>>
>>>> Again, how is the element going to get submitted?
>>> I think you are making to much of this. 
>>> [snipped 100+ lines]
>> No, I'm not.  It's a simple question.
> 
> Which, in order to reiterate it although being answered already, took you
> 138 lines for your readers to download.  Please stay in alt.www.* where
> lusers like you belong.
> 
> 
> Score adjusted
> 
> PointedEars, F'up2 set


ROFLMAO.  Let's see... I don't require users to enable javascript to use 
my sites.  Sure, I use it - to ENHANCE their visit.  But it's not required.

It's one reason why I no longer read comp.lang.javascript - too many 
loosers don't know how to code sites without requiring javascript.

And I see people there still can't answer simple questions.

Fup'd back to comp.lang.javascript.  We only want intelligent posters in 
a.w.w.



-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
0
Jerry
1/3/2009 1:25:31 AM
Jerry Stuckle wrote:
> mynameisnobodyodyssea@googlemail.com wrote:
>> > On Jan 2, 10:30 pm, Jerry Stuckle wrote:
>>> >> PLEASE READ THE QUESTION!  He wants to do it WITHOUT A FORM.
>>> >>
>>> >> Now please tell me how he is going to submit the changes WITHOUT A FORM.
>> > 
>> > AJAX does not really need a form, [...]
> 
> That's fine - and it FINALLY answers my question (I don't use AJAX, 
> obviously).

The greater the idiot, the more floodlight it takes for them to see the truth.


F'up2 alt.www.webmaster

PointedEars
0
Thomas
1/3/2009 1:32:16 AM
On Jan 2, 6:25=A0pm, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> ROFLMAO. =A0Let's see... I don't require users to enable javascript to us=
e
> my sites. =A0Sure, I use it - to ENHANCE their visit. =A0But it's not req=
uired.

Nobody here said they required Ajax on their websites.  Just like any
other JavaScript, Ajax too can be used to enhance their site.

--
Ben | http://allben.net
0
Ben
1/3/2009 1:38:25 AM
Ben Amada wrote:
> On Jan 2, 6:25 pm, Jerry Stuckle <jstuck...@attglobal.net> wrote:
>> ROFLMAO.  Let's see... I don't require users to enable javascript to use
>> my sites.  Sure, I use it - to ENHANCE their visit.  But it's not required.
> 
> Nobody here said they required Ajax on their websites.  Just like any
> other JavaScript, Ajax too can be used to enhance their site.

Please do not feed the troll.


F'up2 PointedEars
0
Thomas
1/3/2009 1:59:49 AM
Jerry Stuckle wrote:
[snip]
> 
> It's one reason why I no longer read comp.lang.javascript - too many 
> loosers don't know how to code sites without requiring javascript.

What did you expect the posts to be about? The clue is in the name of 
the newsgroup.

> 
> And I see people there still can't answer simple questions.

I would say that your question was answered clearly and accurately by 
several people in several different ways. You finally admitted that you 
didn't know anything about AJAX and therefore didn't understand the 
answers you were given but that is not the fault of the people who 
answered. They tried to explain the concept to you but you weren't 
listening.

Steve.
0
SteveYoungTbird
1/3/2009 8:40:12 AM
Jerry Stuckle wrote:

> Until now, EVERY answer was related to submitting forms using AJAX or 
> similar.
> 
> Thanks for the clarification.
> 

Not to pile on Jerry, but I re-scanned the threads and the only one 
saying anything about "submitting a form" was you.  In fact several 
people specifically stated submitting a form, and the form itself were 
not necessary.  As for JS v non-JS sites, or enhancement of a site, the 
OP was very clear his application was very specific, editing a database. 
  It doesn't take much to recognize the intended audience is select. 
There is a difference between an HTML page used as a UI for an 
application, and a web page intended for "public consumption."  Under 
these circumstances, it is not unrealistic to dictate that the user have 
the required setup (i.e. enable JavaScript), or even to make a 
particular browser a requisite.  I personally do a lot of things to 
insure my designs work well across a wide variety of browsers and 
configurations, and break down "gracefully."  Not (generally) employing 
JavaScript is one of them.  However when I have a specific need, and a 
controlled audience I do not hesitate to apply a different set of rules. 
  It explains why I need to come to a place like comp.lang.javascript to 
get help dusting off skill sets I may not have used in some time.
0
William
1/3/2009 9:34:59 AM
Jerry Stuckle wrote:
> William Gill wrote:
>> Jerry Stuckle wrote:
>>
>>> No, I'm not.  It's a simple question.  Without a form, how are you 
>>> going to submit the element to the server?
>>>
>> Jerry,
>> per
>> The XMLHttpRequest Object W3C
>> Working Draft 15 April 2008
>> http://www.w3.org/TR/XMLHttpRequest/
>>
>> "The XMLHttpRequest Object specification defines an API that provides 
>> scripted client functionality for transferring data between a client 
>> and a server. "
> 
> Which doesn't answer my question.
> 
It does actaully.

0
The
1/3/2009 10:29:37 AM
Jerry Stuckle wrote:

> ROFLMAO.  Let's see... I don't require users to enable javascript to use 
> my sites.  Sure, I use it - to ENHANCE their visit.  But it's not required.
> 

Your choice Stucklehead.

> It's one reason why I no longer read comp.lang.javascript - too many 
> loosers don't know how to code sites without requiring javascript.
> 
One reason no one listens to you. You can't spell 'losers'.

> And I see people there still can't answer simple questions.
> 
And we can all see that you can't understand a simple answer when it 
goes against your religion. Cognitive dissonance?


> Fup'd back to comp.lang.javascript.  We only want intelligent posters in 
> a.w.w.

Why are you still there then?
> 
> 
> 
0
The
1/3/2009 10:34:56 AM
The Natural Philosopher wrote:
> Jerry Stuckle wrote:
> 
>> ROFLMAO.  Let's see... I don't require users to enable javascript to 
>> use my sites.  Sure, I use it - to ENHANCE their visit.  But it's not 
>> required.
>>
> 
> Your choice Stucklehead.
> 
>> It's one reason why I no longer read comp.lang.javascript - too many 
>> loosers don't know how to code sites without requiring javascript.
>>
> One reason no one listens to you. You can't spell 'losers'.
> 
>> And I see people there still can't answer simple questions.
>>
> And we can all see that you can't understand a simple answer when it 
> goes against your religion. Cognitive dissonance?
> 
> 
>> Fup'd back to comp.lang.javascript.  We only want intelligent posters 
>> in a.w.w.
> 
> Why are you still there then?
>>
>>
>>
OT, not php related.


Please people. This is a place where people can ask for help. If you 
disagree with something , discuss it like the adults and professionals 
that you are or just ignore the comment.

These are the kind of things that would stop a newbie from asking a 
question.

Why bother cross posting this newsgroup if your not going to include the 
relevant details? You have his email address ,if you really MUST send a 
retort, email it and keep the rest of us who want useful discussions out 
of it.

regards trookat
0
trookat
1/3/2009 11:40:10 AM
William Gill wrote:
> Jerry Stuckle wrote:
> 
>> Until now, EVERY answer was related to submitting forms using AJAX or 
>> similar.
>>
>> Thanks for the clarification.
>>
> 
> Not to pile on Jerry, but I re-scanned the threads and the only one 
> saying anything about "submitting a form" was you.  In fact several 
> people specifically stated submitting a form, and the form itself were 
> not necessary.  As for JS v non-JS sites, or enhancement of a site, the 
> OP was very clear his application was very specific, editing a database. 
>  It doesn't take much to recognize the intended audience is select. 
> There is a difference between an HTML page used as a UI for an 
> application, and a web page intended for "public consumption."  Under 
> these circumstances, it is not unrealistic to dictate that the user have 
> the required setup (i.e. enable JavaScript), or even to make a 
> particular browser a requisite.  I personally do a lot of things to 
> insure my designs work well across a wide variety of browsers and 
> configurations, and break down "gracefully."  Not (generally) employing 
> JavaScript is one of them.  However when I have a specific need, and a 
> controlled audience I do not hesitate to apply a different set of rules. 
>  It explains why I need to come to a place like comp.lang.javascript to 
> get help dusting off skill sets I may not have used in some time.

I did read every one of the responses.  I specifically asked how to 
submit without a form.  Every other response which came back had 
comments similar to "the forum is submitted...".  Until now, NO ONE 
answered my specific question.

Fup'd back to comp.lang.javascript.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
0
Jerry
1/3/2009 12:23:45 PM
trookat wrote:
> The Natural Philosopher wrote:
>> Jerry Stuckle wrote:
>>
>>> ROFLMAO.  Let's see... I don't require users to enable javascript to 
>>> use my sites.  Sure, I use it - to ENHANCE their visit.  But it's not 
>>> required.
>>>
>>
>> Your choice Stucklehead.
>>
>>> It's one reason why I no longer read comp.lang.javascript - too many 
>>> loosers don't know how to code sites without requiring javascript.
>>>
>> One reason no one listens to you. You can't spell 'losers'.
>>
>>> And I see people there still can't answer simple questions.
>>>
>> And we can all see that you can't understand a simple answer when it 
>> goes against your religion. Cognitive dissonance?
>>
>>
>>> Fup'd back to comp.lang.javascript.  We only want intelligent posters 
>>> in a.w.w.
>>
>> Why are you still there then?
>>>
>>>
>>>
> OT, not php related.
> 
> 
> Please people. This is a place where people can ask for help. If you 
> disagree with something , discuss it like the adults and professionals 
> that you are or just ignore the comment.
> 
> These are the kind of things that would stop a newbie from asking a 
> question.
> 
> Why bother cross posting this newsgroup if your not going to include the 
> relevant details? You have his email address ,if you really MUST send a 
> retort, email it and keep the rest of us who want useful discussions out 
> of it.
> 
> regards trookat

He's just a total idiot.  Doesn't even know the difference between 
javascript and php, which is why he posted it here.

A lot of the regulars have plonked him.  He never has contributed 
anything positive to this newsgroup.

Of course he has to post anonymously.  If his clients figured out how 
stoopid he is, they would run to someone competent.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
0
Jerry
1/3/2009 12:27:13 PM
Jerry Stuckle wrote:

> I did read every one of the responses.  I specifically asked how to 
> submit without a form.  Every other response which came back had 
> comments similar to "the forum is submitted...".  Until now, NO ONE 
> answered my specific question.

In my newsreader they came across garbled like:

   "the form itself never gets submitted,"

   "AJAX sends the form value to the server.
    That is what ajax does,"

   "The XMLHttpRequest Object specification defines
    an API that provides scripted client functionality
    for transferring data between a client and a server."

I should look into that.
0
William
1/3/2009 2:50:28 PM
William Gill wrote:
> Jerry Stuckle wrote:
> 
>> I did read every one of the responses.  I specifically asked how to 
>> submit without a form.  Every other response which came back had 
>> comments similar to "the forum is submitted...".  Until now, NO ONE 
>> answered my specific question.
> 
> In my newsreader they came across garbled like:
> 
>   "the form itself never gets submitted,"
> 
>   "AJAX sends the form value to the server.
>    That is what ajax does,"
> 
>   "The XMLHttpRequest Object specification defines
>    an API that provides scripted client functionality
>    for transferring data between a client and a server."
> 
> I should look into that.
OK  I just stumbled across this thread on a HTML site, and found replies 
and comments I hadn't seen before. Looking closely I noticed some 
replies went to comp.lang.javascript and alt.www.webmaster, some did 
not.  It really changed the conversation.  I'll have to be careful to 
watch out for that in the future.  Good thing for me I didn't say 
anything too stupid because I missed something in the middle. <g>

0
William
1/3/2009 6:16:59 PM
Jeff wrote:
>   Just a word on how I'm doing this. I'm IDing the rows with the primary 
> key, IDing the table with the table name and using a class to set the 
> cell the cell. That way you don't have to embed this info in the input 
> name.
> 
My point was you can have a form w/o any submit buttons just like you 
can have an input field w/o a containing form.  That meets your real 
estate concerns, but you can use existing form collections (why recreate 
the wheel?).  It also makes it easier to keep track of the table:input 
field relationship via form name or ID. However, you would need to 
prevent <enter> from "submitting".  Of course if your table structure 
interlaces fields from different tables (i.e table1.fname, table2.city, 
table1.somethingelse) you can't use forms, amd will have to create your 
own structures.

I haven't played with your approach, but on first pass it seems that 
traversing the elements to establish table:input field relationships may 
be more involved and potentially more hazardous.

> 
>   Jeff
> 
>>
>> // in the JS
>> function fieldChanged(caller){
>>    caller.className = "dirty" ;/* CSS class to provide user visual 
>> indication data on the screen is out of sync with the db*/
>>    // do anything else you need
>> }
>> function updateViaAjax(caller){
>>    dbtableName=caller.form.name;
>>    //do some Ajax stuff here
>>    caller.className = "" ;/* (or set to a defined CSS class) 
>> indicating data is back in sync*/
>> }
>>
>> You may want to do something with onSubmit it catch when the user hits 
>> "enter" from within a form, and you could loop through 
>> caller.form.elements looking for objects with className=="dirty" to 
>> find fields in need of updating.  So the "forms" are not completely 
>> useless.
>>
>> Just some food for thought.
0
William
1/3/2009 6:37:56 PM
Reply:

Similar Artilces:

When JavaScript is disabled, do not display HTML form and form elements
On my site, I have 2 methods of displaying my data: 1) HTML form with select-option element. (Jump to different page when clicking "Go" button" 2) HTML table with a hyperlink. What I would like to do is the following: If JavaScript is disabled (or non existant on some browsers), to NOT display the HTML form with select-option element. This will help to keep the webpage cleaner for the viewers. PS: I only have access to client-side scripting. Thanks patricksabou...@hotmail.com wrote: > On my site, > > I have 2 methods of displaying my data: > 1) HTML form w...

Forms and Form
Hi everyone ! 1) An example from help: "Each Form object has a Controls collection, which contains all controls on the form. You can refer to a control on a form either by implicitly or explicitly referring to the Controls collection. Your code will be faster if you refer to the Controls collection implicitly. The following examples show two of the ways you might refer to a control named NewData on the form called OrderForm: ' Implicit reference. Forms!OrderForm!NewData ' Explicit reference. Forms!OrderForm.Controls!NewData The next two examples show how you might refer to a ...

multipage form for 8 form elements?
hi everybody, i'm designing a web application for a client. i've mocked up a wireframe prototype that demonstrates one usage scenario of the web app. this particular scenario involves the user completing a form to upload a file from the user's machine to the web app's server. this upload form has 8 form elements: http://www.javafreelancer.net/soa/upload/index.html my problem is, my client is suggesting that this 8-element form be split across 2 or 3 separate pages because he estimates users will be confused by the over-abundance of 8 form elements on one page. i...

Why am I getting Javascript (form) or (this.form) errors?
In an existing, tested and working program, I have a form entry that simplifies to... <INPUT name ="fp1s" type="text" value=0.000 size=12 > and a button of... <input type="button" value=" Set Amplitude " onclick="setAmplitude (this.form)"> One of the things the setAmplitude function does is calculate a p1s value and then does a... form.fp1s.value = p1s ; This seems to work fine. I wanted to add a new feature to the program by adding a new button of <input type=&quo...

multipage form for 8 form elements?
hi everybody, i'm designing a web application for a client. i've mocked up a wireframe prototype that demonstrates one usage scenario of the web app. this particular scenario involves the user completing a form to upload a file from the user's machine to the web app's server. this upload form has 8 form elements: http://www.javafreelancer.net/soa/upload/index.html my problem is, my client is suggesting that this 8-element form be split across 2 or 3 separate pages because he estimates users will be confused by the over-abundance of 8 form elements on one page. i...

Forms question
Hi folks, I'm new here and am a neophyte Access 2000 user/developer. A year ago, I barely knew what Access was. I was asked by the people that pay us to begin keeping certain data about the children's crisis program I manage. After a couple of years doing this by hand on paper (Yikes!), I decided that this was ridiculous. Out of neccessity, I had to learn Access and develop a database to track clients and services. So what I know, I've learned from places like this and from the many text books I've picked up. I developed the database and entered almost 3 years of data. We av...

getElementById or forms['form'].elements....?
I'm being told to us the identifier: document.getElementById("foo_box").whatever; instead of: document.forms['form'].elements['foo_box'].whatever; Why? -- Ed Jay (remove 'M' to respond by email) Ed Jay wrote: > I'm being told to us the identifier: > document.getElementById("foo_box").whatever; > > instead of: > document.forms['form'].elements['foo_box'].whatever; > > Why? At least show the HTML. Do you want to access an element that has an "id" attribute with the value &...

submitting a form to cgi, without the form object
Hey guys (and girls ;)), Been playing with my perl/jscript knowledge and build a perty neat web app for chating to my friends. In an effort to improve it, I've decided to add some Who's etc... (you don't need those details though)... anyways, I've given the clients a personal ID, and it get's store/created etc... perfectly (as far as it should). Only problem is if the client opens a new browser window, that ID is lost... which is a bad thing (ie: someones name showing up twice in the who's online list)... i've found out why, and what i need to do is su...

sticky form with dynamically generated form element?
Hello, could someone show me how to make sticky form with dynamically generated form element? for example, if one likes to make the dynamically generated check box (and its name) 'sticky' that retains the value of the previously submitted value. How would one do that? TIA. I was thinking something along this line but not sure it's the right way to accomplish this task <?php echo "<input name='$dynamicallygenerated' value='$temp' type='checkbox' />"; $temp= $_POST[$dynamicallygenerated]; ?> On Fri, 24 Oct 2008 22:37:01 +0200, <st...

Move value from one form element to another, hidden element via JavaScript
I am working on changing some HTML. I need to find how the value of a hidden field is being set. The value of the hidden field will be set based upon a user selection. This HTML has a hidden field. The value of the hidden field comes from a value that is not displayed but is associated with a field in a select list that is displayed (after being populated on the fly). The author of this 4000+ line HTML file, wrote JavaScript that is well beyond my "a little past beginner" JavaScript knowledge. What I need is to figure out where the code is that moves a value to this hidden fi...

Forms and form processing.
Hello all, Right now, I'm kind of oblivious as to how forms get processed, but I'l like to be enlightened. Right now, All the websites I run use the FrontPage extensions. I assume these extensions do things like form submission, guest book maintenace, hit counter counts, etc. All my sites are manually coded, but I do use the built-in guest book, built-in hit counter, and forms. Right now, when someone submits a form, I get an e-mail from my webhost with all the form information in it. The e-mail body looks like this: Name: Joe E-Mail: name@isp.com Address:...

Form
I have a table TBL_NAMES : IDNAME , Name_person , ETC..... (15 different labels) I have a second table TBL_POINTS : IDPOINTS , LINKNAME_PERSON , POINTS_ALGEBRA , POINTS_GYM , etc.... (25 courses) I have made a form where all the names are listed and when i click on a name another form is opened with that persons name on top and a number of labels and textboxes where i put those points in. So far no problem. BUT... i want one record per person. So the next time i click on his name i would like to see those points and be able to change them but i must not be able to create a new record. T...

first form is ignored, second form is forms[0] why?
Does anyone recognize this situation and know what causes it ? The page starts with just a search form. When you do a search the page now has a search results form, a save botton, and the search form at the bottom. There is also a link to add another form with a dropdown. If you add the third form the page has the search results form, the form with the dropdown and the search form, in that order. The save button is set to submit the search results, which is always forms[0]. If the page has all 3 forms, it works fine. The first form is submitted,and it is the correct form. If however, the ...

forms embedded in form
the html4.01 standard alludes to the possibility of forms within a form. i could not deduce what the intended action should be when the outermost form is submitted. all inputs submitted? only the non-inner inputs submitted? i infer that a designer might use embedded forms to create a stylistic hierarchy, in which a "form{...}" has one style but a "form form{...}" has another style. meanwhile i tried it in ie6 using bad-blue and the inner forms behaved normally, but the outer form was inert. what's supposed to happen? tia. -- dave mausner v.708-848-2775 c.31...

Web resources about - form element without forms - comp.lang.javascript

Éléments de géométrie algébrique - Wikipedia, the free encyclopedia
The Éléments de géométrie algébrique ("Elements of Algebraic Geometry ") by Alexander Grothendieck (assisted by Jean Dieudonné ), or EGA for ...

We should care about the discovery of new elements: they help us see the universe with awe
... that knowledge in our day-to-day lives. On December 30, the International Union of Pure and Applied Chemistry announced that four new elements ...

"Periodic table's seventh row finally filled as four new elements are added."
"Discovery of four super-heavy chemical elements by scientists in Russia, America and Japan has been verified by experts and formally added to ...

petition asks to have a heavy metal element on the periodic table named after Lemmy
Lemmy w/ Motörhead in Austin, 2015 (more by Tim Griffin) Heavy rock lost its most iconic figure over Christmas with the sudden and unexpected ...

Obama talks about Kendrick Lamar, naming an element after himself
The president answered a whole range of serious and lighthearted questions from Youtube stars on Friday

ShmooCon: LastPass design elements create perfect Phishing opportunity
... CTO of Praesidio, demonstrated a clever attack against LastPass, which is possible thanks to a security trade off and easily spoofed UX elements. ...

7 Crucial Elements Of The #OregonUnderAttack Narrative That Go Overlooked
By the standards the media is apply to the militia, former U.S. Attorney General Eric Holder is a terrorist.

Oscar Nominations: Friendship Is Crucial Element For ‘Room”s Lenny Abrahamson And Ed Guiney
... together 35 years ago, when they were at university, as they made a documentary about Abrahamson’s grandfather. Since then, Guiney’s Element ...

For Honor will definitely have a campaign element after complaints to Ubisoft
... seems to be coming along nicely. One big revelation however is that Cardin and his team are definitely going to have a campaign element, after ...

More than half of major new business processes and systems will incorporate some element of IoT by 2020 ...
More than half of major new business processes and systems will incorporate some element of the Internet of Things (IoT) by 2020, according to ...

Resources last updated: 1/24/2016 8:04:44 AM