| |
| |
| |
|
Page: 1 2 3
Comments:
<0> Don't repeat <0> What's the code of isAllFieldsFilled? <1> empty... <1> for now... <0> So how do you know it doesn't work? <1> but I get an error saying the function addEventListener doesnt apply to a form element <1> "Object Doesnt support this property or method" <0> Apply it to the elements then? <1> document.elements[x] ? <0> document.forms[x].elements[y] <1> I need it on the form, I need a onsubmit... <0> Why have you put it on focus then? <1> sorry for test purposes... its "submit" not focus <0> document.forms[x].onsubmit = isAllFieldsFilled; <1> will I be able to use "this" the documentation says no <0> Then the documentation is wrong.
<1> lol ok I'll try it thanks <0> You're probably confusing it with <form ... onsubmit="foo();"> in which case 'this' would refer to the window. <0> Not so when you do formRef.onsubmit = foo; <1> hmmm something doesnt work... <1> document.forms[x].onsubmit = 'isAllFieldsFilled'; <2> speaking of forms. Any idea why document.forms['myform'].submit; doesn't work for me? <1> I think you need the numerical index of it... <1> .forms[0] <1> or document.myform.submit <1> or document.getElementById('form') or document.getElementByName('myform') <0> Herrick: Don't quote the function name. <0> And no, you don't need a numerical index. <0> And it's .submit() <1> oups sorry <1> I think I'll shut up :) <2> that's odd. doc.myform.submit doesn't work. (checked the spelling twice). But a submit button does. Maybe I have a problem elsewhere. <0> Sukotto: .submit(); not .submit; <0> And don't name your submit button "submit" <0> (Did I just hit bingo? :-)) <1> Pilum: the onsubmit works only if I do a submit button... if I use form.submit() it doesnt gets called is that normal ? <0> document.forms['myform'].submit(); // works as long as you have nothing with name="submit" on your page. <0> Or this.submit(); in your function. <2> yeah, that's a bingo :-) <2> thanks <3> anyone here know how I can set an onclick handler for an <a> tag, cause when I try it, it doesnt work <0> What do you do then? <3> I'll put a pastebin <3> http://pastebin.com/710626 <3> there <3> I'm sure this works before, but I can't get it to wor now <3> an example page is http://www.comingevents.org/convertable2-dev/php/index.php (wait a couple of seconds) then right at the bottom, below the "footer" <3> Pilum: when I click one of the links at the very bottom, it just navigates to js/js2.php <3> which is _NOT_ supposed to happen, if you return false from the onclick handler, right? <0> Right. <3> but it does <3> so wtf <0> document.links[document.links.length-1].onclick returns 'undefined' <3> hmm <0> Your function is correct though... <3> Pilum: incidentally, all the href/onclick elements in the links array are undefined <3> check the page now, I loop through EVERY item in the array and output href/onclick <0> And incidently the same thing you're doing works perfectly here. <3> wha? <0> Basically anyway. <3> don't click the links between the two grey bar <3> they are going to work anyway, cause they are different, I'm talking about the items below the bottom grey bar, they are like in a stepping fashion cause of all the text output <0> I wasn't. <3> oh <3> so you clikc and the video runs? <3> oh wait, no it won't, cause of return false <0> http://www.html-channel.com/pastebin.php?id=2 <- my test code <3> yeah, looks identical <3> my code however doesnt do that <0> Sounds like you have something somewhere which interferes with it. <3> yeah maybe <2> hmm... IE appears to be caching my ajax requests so my page never changes. <0> Heh. <3> Sukotto easy fix for that <0> Haven't experienced that myself.
<2> turn of the async part of ajax? <3> http://pastebin.com/710644 <3> no, use cache control headers like that <2> thanks, I'll try that <2> there's also this which I just found: http://www.enja.org/david/?p=25 <2> (use POST instead of GET) <3> ah, well I guess it's up to you, thats how I fixed it <0> Ah. That'd explain it. I always used POST hehe. <2> The more fancy stuff I try to do with js/css/etc, the more I grow to hate IE <0> Pretty common that. <3> yeah, I totally agree with that <2> thanks kosh[0] , changing to POST worked so I didn't try your solution <3> well anyway, something you can reference if you needed it <2> yes, for sure <4> hello <0> Hello. <4> which is alternative for document.createElement() for _downlevel_ browsers? <0> There isn't one really. <0> Just a few things like new Option() <4> thank you, will try as i want to add option to select :) <0> http://www.quirksmode.org/js/options.html' <5> quick question: what's wrong with this? onclick="javascript:match(document.form1.p***word, document.form1.p***word_confirm)" <5> should there be "'s or something= <5> ? <0> The "javascript:" part for starters <0> Having a field named "p***word" might cause conflicts as well. <0> As might "match" if that's a custom function. <5> the javascript: shouldn't be there? <0> No. <5> oh...when am I supposed to use that, then? <0> Nothing. <0> Just remove it entirely. <0> onclick="match(....);" <5> ok...but i've seen people use javascript: every now and then? <0> Because they're ignorant. <5> ah. so forget that, then. <0> It was originally used in href on links, before onclick and other event handlers were introduced. And even then it was a hack,. <0> And now it's somehow spread to event handlers. <5> i see <0> match() is a built-in regexp function so you might try changing its name. If that doesn't work then it's probably something in the function itself. ***uming the references you p*** as arguments are correct. <5> i get the 'is null or not an object' on form1.p***word.value <0> Change the name then. Probably conflicting with the p***word type. <5> whops, got it working. silly me. <5> just a typo. thanks for your help! <0> Np. <5> Pilum: could you have a quick look at this 7-line snippet? http://pastebin.com/710952 ie reports an error on line 6. <6> document.forms['form1'].submit(); <5> sk8ing: no go <5> anyway, that shouldn't be necessary, i think <5> ah, got it working. there was a button named 'submit' causing the trouble. <5> thanks for you help, guys <7> hey guys... i got a questino... i have some html mixed with js that im trying to set using innerHTML, ive already researched to find that innerHTML doesnt parse javascript so im just wondering how can i dynamically add js to the page, i was thinking parsing the innerHTML content to extract the js maybe a regular exp and add that to the head node sort of thing... does that sound right or is there a better way? <0> Where do you get this js from? <7> ummm its comming from the server <7> im using A..x <7> you cant say it here :) <8> if it's pure js, load it via a script tag <8> either that or eval it <7> thats the thing... its not <8> then wtf are you thinking? <7> the js is obviously withing the <script... tags <8> gotta point an iframe at it then <0> You should make it pure js then, and make it attach itself as it were to the html afterwards. <7> thats why i was asking if maybe i can parse the innerHTML content to retrieve the js <7> which i can then attach etc.... <0> And you can't set the server to generate the js seperately? <0> And don't give me an answer to which the answer to the following "why?" is "because I'm too lazy" <7> its not about been lazy.... its just that js and the html is the output of numerous server files... <7> basically <7> doing what you suggested would mean two server calls <0> Bad software architecture in other words. <7> and most likely parsing through the same data...
Return to
#javascript or Go to some related
logs:
tista tkun int #networking #chatzone #java #linux #AllNiteCafe #linux #linux #linuxhelp #linux
|
|