@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4 5



Comments:

<0> mind you, im invoking the function on focus
<1> And?
<0> <input type="text" value="someval" onfocus="this.selectionStart=this.value.length;this.selectionEnd=this.value.length;">
<0> that what you mean?
<0> its selecting everything
<0> and it does that even without the onfocus bit
<0> oh, it does that if im focusing from a previous field
<0> my cursor is from another textfield and when i change to this certain field, i want it to go to the end.
<1> Tab'ing doesn't trigger onfocus afaik.
<0> well i tried an onfocus="alert('focus');"
<1> And if it does, then default behaviour must be overriding it.
<0> i think so too
<1> The select part that is.
<0> well, maybe i could detect the tab and replace it?
<1> Write a script to replace the tab'ing you mean?
<0> yeah.



<0> when tab is pressed, do this
<0> etc..
<1> Well good luck on that one.
<1> Should be doable, but it'll take you a while I imagine.
<0> oh
<0> or i'll just simulate a keypress for "End"? lol
<1> Hehe
<2> hey can someone look at this for a sec?
<2> http://pastebot.nd.edu/701
<2> im getting an error on it
<1> courseNameArray[]; <- ?
<3> MAS84: you want to add a new option to an existing <select> ?
<1> Don't say anything... you normally just do PHP, right?
<3> hehe
<1> "[]" in names really mess it up for js.
<3> MAS84: var tmp = document.form.yourSelect; tmp.options[tmp.options.length] = new Option("foo", "bar")l
<3> s/l$/;/
<2> hey sorry got disconnected
<1> var mySelect = document.forms['nazScheduler'].elements['courseNameArray[]'];
<1> "[]" in names really mess it up for js.
<3> MAS84: you want to add a new option to an existing <select>?
<2> hmmm
<2> elements['courseNameArray[]']; <---is that supposed to be the name or the id?
<2> for the select list
<3> MAS84: what you want to do? add a new option to the list?
<1> Either.
<1> Frankly, you've no use for an id there.
<1> Might as well remove it.
<3> cause if thats what you want to do: var tmp = document.form.yourSelect; tmp.options[tmp.options.length] = new Option("foo", "bar");
<2> well the name has to be courseNameArray[] so that i can p*** it to php as an array...so im thinking the id can be courseNameArray without the "[]"
<3> hehe
<1> And I'm telling you how to obtain the reference, and that you don't need an id.
<3> and you wont be able to p*** a JavaScript array to PHP like this, you need to send it as a querystring or to post it.
<1> HuSoft: Yes he will.
<3> really? how?
<1> Just like that.
<3> just like that, PHP get this JS var!
<1> It's a form.
<3> he needs to SUBMIT the form and the form fields will p*** the value to php
<2> right that's what im going to do
<1> Naturally. But that's not the issue here
<2> im not talking about a javacript array
<1> He has an element with name="courseNameArray[]" and he tried to reference it like you do, instead of how I do it, and that fails when he has [] in the name.
<3> Pilum: thats what I said, you need to send it as a QueryString or to Post it!
<1> But that's not relevant now.
<3> bah
<4> hey guys... me again
<1> MAS84: Having "[]" in an ID is not valid html btw.
<1> But it is allowed in name.
<4> i got my ajax username checking working
<3> _Dom_: good
<4> however in internet explorer it wont allow usernames under 4 characters
<4> in FF and opera it works fine
<2> http://pastebin.com/573282
<2> i know it's not 100% valid but can you see anything wrong w/ that
<2> im getting closer, but it's not quite working yet
<2> oh wait
<2> i think i know
<1> elements["courseNameArray[]"] <- doesn't have .value
<2> right
<2> i changed that to courseName



<2> because that's the name of the text field
<1> myNewOption.text = mySelect.options[mySelect.selectedIndex].value;
<2> but still didnt work
<4> ok heres the cut code :)
<4> http://pastebin.com/573286
<4> works perfect in FF and opera
<4> but wont accept anything with less than 4 characters in IE
<1> Just an observation:
<1> Change sndReq(document.getElementById('usernametext').value); to sndReq(this.value);
<2> pilum, any ideas on my situation
<1> Tou tried my suggestion?
<2> yep but i actually changed it to courseName
<1> Irrelevant really.
<2> http://pastebin.com/573323 my latest
<1> Does not contain my latest correction...
<2> the sndReq?
<1> <1> myNewOption.text = mySelect.options[mySelect.selectedIndex].value;
<2> i had the mySelect.selectedIndex in the brackets but did not work
<4> why do some pople use return false;?
<4> when using inline javascript
<4> ok im really confused now. the javascript works on certain 3 letter words but not on others
<4> its not the php because that gives off a 1 or a 0 depending on what is sent
<3> MAS84: get your working code here: http://pastebin.com/573366
<3> isnt that what you needed?
<3> You first select the checkbox you want the text to go to, then you click the button
<1> HuSoft: You have two name attributes on each of them. :-)
<1> Bah
<3> yup, one with the real name hes waiting and the other is just to make a relation on the fly
<3> ahh, you mean name="txtField1" and id="courseName"
<3> uUps, forgot to delete it from he's html file
<1> I must have missed quite a lot of conversation.
<3> :]
<3> Pilum: no, he told me thats what he wanted on privmsg
<1> Then pls keep it there instead of confusing me. :-P
<3> sorry, just was pasting so everyone could see the solution
<1> That's just confusing when we don't know the problem, wouldn't you agree? :-)
<3> ok
<2> pilum this is what i was trying to do
<2> http://pastebin.com/573432
<2> thanks a ton husoft
<3> np MAS84
<2> you're the js master
<2> lol
<2> anyway i gotta get going
<3> heh
<3> ok, l8r
<3> well, Im out
<5> whats a quick way to create a delay in JS?
<5> like i just want the js to pause for half a second while a visual effect finishes
<1> setTimeout
<5> k
<5> thanks
<5> does it use seconds or ms?
<6> ms
<7> heya exa :D
<5> heya var
<7> how are yeh doing?
<5> good... just trying to learn js and ajax
<5> i've already made some pretty sweet use of XMLHttpRequest
<7> show me :D
<5> aight... i'll upload what i got to linkleaf.com now... its still a bit buggy though
<5> exacube: log into linkleaf.com, create a folder by clicking on "new child" and then afterwards delete that folder by clicking on "action" and then "delete"
<5> and then you'll see the full extent of what I have working so far
<5> got some pretty slick effects
<5> so far
<5> have a long way to go though
<5> the delete button is the only thing that really uses ajax... the rest is just JS effects
<5> eventually most of the actions will trigger ajax events
<7> holy ****
<7> that's a really cool JS effect
<8> hey. I get function is not defined when calling onClick="adicionar(0)"; my function is defined as "function adicionar(instrument) {
<8> }
<1> I've found that error msg to be inaccurate.


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #javascript
or
Go to some related logs:

martin_uk
mrtg + atm + flat line
karen transgirl
#chatzone
palmiros
#linux
Pi-ADL
#networking
#linux
#AllNiteCafe



Home  |  disclaimer  |  contact  |  submit quotes