By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,714 Members | 1,182 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,714 IT Pros & Developers. It's quick & easy.

ajax question

P: n/a
Hello,

I have begun working with ajax recently to populate a drop down in a
form, where prviously the whole page would have to reload. Works great.

Where the form originally had a standard drop down like this:

<Select Method="ShippingMethod">
<option>method1</option>
<option>method2</option>
<option>method3</option>
</Select>

It now pulls form an external page and ajax uses

document.getElementById('myspan').innerHTML = result;

and puts it here inside my form:

<form name="form1">
(stuff snipped)
<span name="myspan" id="myspan"></span>
</form>

All works well in that the form posts properly.

However, previously there was the following javascript to trigger a
function when the <Select Method="ShipingMethod"was changed:

<script language="JavaScript" type="text/JavaScript">
document.getElementsByName("ShippingMethod")[0].onchange=total;
</SCRIPT>

This now results in an error:

document.form1.ShippingMethod is null or not an object

What do I do about that?
Aug 21 '08 #1
Share this Question
Share on Google+
9 Replies


P: n/a
" <Select Method="ShippingMethod""
This is a typo. Should of course be <Select Name="ShippingMethod">

One other problem is that there is a validation script that runs to make
sure someone has selected an option, as the first one in the list is

<option value="">Please Select</option>
if (theForm.ShippingMethod.value == "")
{
alert("Please Select a shipping method.");
theForm.ShippingMethod.focus();
return (false);
}

This still works with the ajax version in IE but now fails in Mozilla.
Aug 21 '08 #2

P: n/a
Alex wrote:
As stated, the Select Method was a typo.
Please forgive me for replying one minute before that. I really should have
asked my crystal ball first, but it is currently under maintenance, you see.
Also, things were snipped for brevity.
Very clever. NOT.
Of course the <formhas an action.
Post it, then.
I have done away with

document.getElementsByName("ShippingMethod")[0].onchange=total;

as you are right it needless. So that problem is solved. The one
regarding the validation remains.
PEBKAC. Trust me.
[Top post]
You are quoting like a bat. Please stop that. [tm]
PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
Aug 21 '08 #3

P: n/a
MC wrote:
We can't all be .js experts and worship your greatness oh one of great
talent.

Geez, can't you be nice to anybody???? or is it your goal to belittle
and put down everyone here?
For me it has been easier not to get upset when I imagine, that any
irritating person in fact may be sick, suffering from Asperger syndrome,
ADHD, autism or some other personal disorder. I pretend for myself being a
physician observing the person and asking myself: is it wise for me to start
shouting and screaming with red face, kicking chairs and spoiling my day,
when I have got such a patient to talk with?

I do not claim any poster here in reality has such disorders. It is my
imagination only and on purpose. If one has not had the opportunity to live
with a person having e.g. Asperger syndrome, then it might help to google
with the word and get astonished. When being extreme cases those people can
be so astonishing that after some time you might feel they are sympathetic
in their almost complete inability to understand human feelings. Is it their
fault if they are sick?


Aug 25 '08 #4

P: n/a
MC
Thank you for the laugh!

Yes,
It almost does seem as if he has mental issues. The bitter vile tone of
messages actually makes me not want the help he provides. Its like buying
gas, you need it, but you cringe every time you have to get some.
"optimistx" <op*************@poistahotmail.comwrote in message
news:48***********************@news.24online.fi...
MC wrote:
>We can't all be .js experts and worship your greatness oh one of great
talent.

Geez, can't you be nice to anybody???? or is it your goal to belittle
and put down everyone here?

For me it has been easier not to get upset when I imagine, that any
irritating person in fact may be sick, suffering from Asperger syndrome,
ADHD, autism or some other personal disorder. I pretend for myself being a
physician observing the person and asking myself: is it wise for me to
start
shouting and screaming with red face, kicking chairs and spoiling my day,
when I have got such a patient to talk with?

I do not claim any poster here in reality has such disorders. It is my
imagination only and on purpose. If one has not had the opportunity to
live
with a person having e.g. Asperger syndrome, then it might help to google
with the word and get astonished. When being extreme cases those people
can
be so astonishing that after some time you might feel they are sympathetic
in their almost complete inability to understand human feelings. Is it
their
fault if they are sick?


Aug 25 '08 #5

P: n/a
On Aug 25, 8:10�am, "optimistx" <optimistxPoi...@poistahotmail.com>
wrote:
MC wrote:
We can't all be .js experts and worship your greatness oh one of great
talent.
Geez, can't you be nice to anybody???? or is it your goal to belittle
and put down everyone here?

For me it has been easier not to get upset when I imagine, that any
irritating person in fact may be sick, suffering fromAspergersyndrome,
ADHD, autism or some other personal disorder. I pretend for myself being a
physician observing the person and asking myself: is it wise for me to start
shouting and screaming with red face, kicking chairs and spoiling my day,
when I have got such a patient to talk with?

I do not claim any poster here in reality has such disorders. It is my
imagination only and on purpose. If one has not had the opportunity to live
with a person having e.g.Aspergersyndrome, then it might help to google
with the word and get astonished. When being extreme cases those people can
be so astonishing that after some time you might feel they are sympathetic
in their almost complete inability to understand human feelings. Is it their
fault if they are sick?


People with Asperger's are NOT irritating.

People without Asperger's though are highly irritating TO US!!!

I find this extremelly offensive what the person wrote about
Asperger's people in such a derogaroty way, but maybe it's not his
fault, maybe he is just 'diseased' with something called IGNORANCE?

I think so.

Roza
www.myspace.com/rozagy

Autistic, beautiful girl and proud of being ME!
Aug 25 '08 #6

P: n/a
On Aug 25, 5:52�pm, "MC" <mica[removethis]@aisus.comwrote:
Thank you for the laugh!

Yes,
It almost does seem as if he has mental issues. The bitter vile tone of
messages actually makes me not want the help he provides. Its like buying
gas, you need it, but you cringe every time you have to get some.

"optimistx" <optimistxPoi...@poistahotmail.comwrote in message

news:48***********************@news.24online.fi...
MC wrote:
We can't all be .js experts and worship your greatness oh one of great
talent.
Geez, can't you be nice to anybody???? or is it your goal to belittle
and put down everyone here?
For me it has been easier not to get upset when I imagine, that any
irritating person in fact may be sick, suffering fromAspergersyndrome,
ADHD, autism or some other personal disorder. I pretend for myself being a
physician observing the person and asking myself: is it wise for me to
start
shouting and screaming with red face, kicking chairs and spoiling my day,
when I have got such a patient to talk with?
I do not claim any poster here in reality has such disorders. It is my
imagination only and on purpose. If one has not had the opportunity to
live
with a person having e.g.Aspergersyndrome, then it might help to google
with the word and get astonished. When being extreme cases those people
can
be so astonishing that after some time you might feel they are sympathetic
in their almost complete inability to understand human feelings. Is it
their
fault if they are sick?- Hide quoted text -

- Show quoted text -


Yes, Gas, I hear it - coming out of your mouth.

what do you use to talk then, your big fat a** LOL :-))))))

Aug 25 '08 #7

P: n/a
On Aug 25, 8:10�am, "optimistx" <optimistxPoi...@poistahotmail.com>
wrote:
MC wrote:
We can't all be .js experts and worship your greatness oh one of great
talent.
Geez, can't you be nice to anybody???? or is it your goal to belittle
and put down everyone here?

For me it has been easier not to get upset when I imagine, that any
irritating person in fact may be sick, suffering fromAspergersyndrome,
ADHD, autism or some other personal disorder. I pretend for myself being a
physician observing the person and asking myself: is it wise for me to start
shouting and screaming with red face, kicking chairs and spoiling my day,
when I have got such a patient to talk with?

I do not claim any poster here in reality has such disorders. It is my
imagination only and on purpose. If one has not had the opportunity to live
with a person having e.g.Aspergersyndrome, then it might help to google
with the word and get astonished. When being extreme cases those people can
be so astonishing that after some time you might feel they are sympathetic
in their almost complete inability to understand human feelings. Is it their
fault if they are sick?

THIS is a bunch of crap you wrote here! And your English is awful!

English is my second language, too but my God, yours is something
else...

Aug 25 '08 #8

P: n/a
Rozagy, artistic Autistic wrote:
"optimistx" wrote:
>MC wrote:
>>[...]
[...]
[...]
Could the three of you please FOAD? Thanks in advance.
PointedEars, f1
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f8*******************@news.demon.co.uk>
Aug 25 '08 #9

P: n/a
Sn!pe crossposted mindboggingly stupid:
optimistx <op*************@poistahotmail.comwrote:
>Thomas 'PointedEars' Lahn wrote:
>>Rozagy, artistic Autistic wrote:
"optimistx" wrote:
MC wrote:
>[...]
[...]
[...]
Could the three of you please FOAD? Thanks in advance.
PointedEars, f1
Sorry, I will not FOAD. FYI, TPAC because ITIOT is very typical for ASP.

[ahem] 'scuse me, guys; is this article yours?
It seems to have crept through a gap in the fence.
*plonk*
Aug 26 '08 #10

This discussion thread is closed

Replies have been disabled for this discussion.