[Proto-Scripty] Re: I can't show a Dialog.confirm on the unload event - Please help!

2009-03-10 Thread Quleczka

 There's another, less bullet-proof solution, which involves catching
 and stopping all click (an possibly keypress) events on links.

But what about situation when someone type new url , press home button
or one from favourites toolbar?

Quleczka


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: forms - serialize and more

2009-03-10 Thread Quleczka

 Explorer is hanging up after giving a 'null' response for the alert
 below - but, firefox is not even hitting the alert and is processing
 normally, thogh it does not have the code to complete the AJAX
 request, just redirects to redo the original page

If you don't use event.stop() for is just submitted without waiting
for anything from ajax...

you have mess in your code... I fixed it and posted here 
http://pastie.org/413066

it is working now :)

you don't use observe in onSubmit...it is pointless :)

as soon as I address my form, I get an error -
either firefox says the form has no properties or it just hangs at
the
place where I address 

No one can't help you with this serializing problem without some
simplified working example of  your form.

By the way are you using firebug to debug this?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: forms - serialize and more

2009-03-09 Thread Quleczka

Hi,

First of all I'm not prototype expert, rather newbie ;)

1) why do you use onsubmit=validatethis();  if you can use  $
('formlinks').observe('submit',validatethis);

2) you don't have to set asynchronous:true - it's default value

3) most common is  parameters: $('formlinks').serialize(true) than
using postBody

4) use  parameters: { dept: $F('dept'), reg: $F('reg') } instead of
this long  postBody:'dept='+department+'reg='+region ...this looks
really bad !!! ;)

you can also try to use $('formname').serializeElements( elements
selection go here)

for example $('formname').getInputs('text') which selects all input
textfields from the same form or something similar ...you can use
Element.select() or $$() if these elements have something in common
(like class, type etc.) - any group of elements can go into
serializeElements()

5) where do you use mlprerresult variable? cause there is quite big
chance that you don't have this variable set by ajax request cause
before loadMenu() is called

6) as far as I understand logic of  this app it would be better to
call  loadmenu(); inside reportresult(); than it's sure it is called
only after success of  ajax request

7) can't you get this data from 'site/traderhomecenter.php' or 'site/
adminhomecenter.php in response of first ajax request already? are
the  values  $F('mlptrader'); $F('mlpdepartment');  etc. from form
'formlinks'?

if yes... you passed it all to the server already in first ajax
request ... so can't you make one more php file which will calls
'Admin/editmylinks2' inside and instead of returning just 'good'
returns result of traderhomecenter.php or adminhomecenter.pl? or just
change editmylinks2 to return this?

you can send good if you want is x-json header of the same ajax
response and in the body you can send html which you want to use to
update  MiddleContent'

simple example of php
--
$response = array ('good'=true);
header('X-JSON: ('.json_encode($response).')');
if ($_POST('mlptrader'))
   die (variable with html you get from traderhomecenter);
else
   die (variable with html you get from adminhomecenter);

and then in javascript

function reportresult(transport) {
var good = transport.headerJSON.good;
if (good){
document.getElementById(mlprerresult).innerHTML =
'Your request
completed successfully';

//instead of ajax updater just update $('Middle Contect').innerHTML
here with what you have in transport.responseText
}else
document.getElementById(mlprerresult).innerHTML =
'Your request
failed!!!';
-

These are my thought to make it easier but I'm not sure I understand
correctly logic of your application.

Quleczka


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: I can't show a Dialog.confirm on the unload event - Please help!

2009-03-09 Thread Quleczka

My first thought was gmail scenario as well :)

Even google use just confirmation dialog...I've never seen any other
type - so I guess you have to live with it ;)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Is this a bug in select()'s CSS evaluation, or am I misunderstandig something?

2009-03-08 Thread Quleczka



On 8 Mar, 14:51, Marc Liyanage liyan...@gmail.com wrote:
 From my experiments I get the impression that the select() context
 element and all of its ancestors are completely taken out of the
 selector match calculation.

Exaclty :)

It selects from elements INSIDE of given one. So it can find only 2
elements because first one is not considered as matching the rule
'div.div_a  span.span_a' cause first div is the one you use to call
select function.

From documentation:
Takes an arbitrary number of CSS selectors (strings) and returns an
array of extended descendants of element that match any of them.

It does not count selectors which are not inside of given context.
You have to use element.select on highter level or $$() instead.

Quleczka

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: How to get the latest prototypejs source under windows system?

2009-03-07 Thread Quleczka

Hi,

  How to get the latest prototypejs source under windows system?

Do you mean how to get the current release right now or how to make it
automatically every time when new version is available?

I don't really get your question.

You can simply download it from http://prototypejs.org/download or
check google ajax libraries page
http://code.google.com/intl/pl/apis/ajaxlibs/documentation/index.html#prototype

Quleczka
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: writeAttribute problem

2009-03-05 Thread Quleczka

Hi,

 That may have well been the case.  I was trying to use writeAttribute with a
 Text Input.  I assumed that it would work and apparent does in IE7.

I'm curious, which attribute were you trying to set -  just a value
of  this input field?

 - For setting or getting the value attribute of Form elements (use
 FormElement#(get|set)Value instead).

Lee, is there a setValue()?

Only getValue is mentioned in API Docs -  
http://prototypejs.org/api/form/element
.

I use just something.value='test'; and it's working :)

Quleczka
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: General Questions

2009-03-05 Thread Quleczka

 script type=text/javascript src=http://ajax.googleapis.com/ajax/
 libs/prototype/1.6.0.3/prototype.js/script
 script type=text/javascript
 Event.observe(window, 'load', function() {

 });

 /script
 /body

Why?

Why not include prototype and other things in the head section of the
page?  If you use observe it on window load it doesn't haveto byat the
end of the page.


Bythe way, you can also use dom:loaded instead of window load :)
--
From API Docs (http://prototypejs.org/api/event/observe) :

Of course, you'd want this line of code to run once the form exists
in the DOM; but putting inline scripts in the document is pretty
obtrusive, so instead we'll go for a simple approach that waits till
the page is fully loaded:

Event.observe(window, 'load', function() {
  Event.observe('signinForm', 'submit', checkForm);
});

Just a little wrapping…

Note that if your page is heavy, you might want to run this code
before the page is fully loaded: just wait until the DOM is loaded,
that will be enough. (Prototype's dom:loaded event can help you with
that.)
--
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Position of div with suggests

2009-03-05 Thread Quleczka

 Is it possible, to manually set the div's position? I had another
 autocomplete script before, where I could playce the div via
 stylesheets and it worked perfect in every browser. Now in
 scriptaculous' autocomplete script no settings related to the div's
 width or position are working.

What do you mean? You can use stylesheet :)

CSS The styling of the div and the returned UL are important.
Applying a visual cue that an item is selected allows the user to take
advantage of the keyboard navigation of the dropdown and adding
background colors, borders, positioning, etc to the div (as the demo
does) allows the UI element to stand out.

From http://wiki.github.com/madrobby/scriptaculous/ajax-autocompleter

There is even style for div.autocomplete and other classes from
example included.
Like this ones:

div.autocomplete {
  position:absolute;
  width:250px;
  background-color:white;
  border:1px solid #888;
  margin:0;
  padding:0;
}

Quleczka
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Processing Ajax.updater response before updating container

2009-03-05 Thread Quleczka

 In my framework, sometimes there is debugging information dumped at
 the bottom of the page. I would like to know what the easiest way to
 scrub that debug output would be with prototype.  My framework
 outputs a very unique string before the debug output. So, a simple
 substring-before would do the trick.

I'm new to prototype as well:)

I don't see option to do something else before updating container...
but it is really easy to make your own ajax.updater  - I mean just
new ajax.request which will do what you want and then update the
container.

It is really easy :) Look at the basic example at 
http://prototypejs.org/api/ajax/request
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: writeAttribute problem

2009-03-05 Thread Quleczka

 It's ok, I can use the method you mentioned
 above for Form Elements and the generic version for others.

I think $(a).attribute=value; works for both types... but I'm not the
expert ;)

Good luck :)

Quleczka
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Password field as hint

2009-03-03 Thread Quleczka

Hi,

On 3 Mar, 06:00, Walter Lee Davis wa...@wdstudio.com wrote:
 See if this would help you. It's based on the classic A List Apart
 article, but just written now off the top of my head:

I can be wrong but honestly I can't see how this script can set lebel
text into input field with especially with label.setStyle({zIndex:
2,position:'absolute',top:'3px',left:'3px',color:'#666'}); which set
all labels in the same top corner of page ?

Even if  it does somehow ...inserting label text value into password
input field will produce asterixes there not letters - that is main
problem  :)

http://dl.getdropbox.com/u/530105/registerform.html

Quleczka


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Password field as hint

2009-03-02 Thread Quleczka

Hi,

I had the same problem yesterday.

Basic simple working example is  here: 
http://dl.getdropbox.com/u/530105/input.html.
Just check it - all in one file.

Script which I've created last night which is working on all input
fields on a page is here http://pastie.org/404519. It is really messy
but it works.

You have it also here http://dl.getdropbox.com/u/530105/inputfields.js.
Just include it in your code, check if you have prototype included
and it will replace all things like :

label for=usernameUsername/label
input type=text id=username name=username /

I'll post something more when I make it look nicer. I hope this give
you some hint :)


Quleczka

p.s. it is based on
http://www.folksonomy.org/2009/01/12/changing-input-type-from-text-to-password-in-internet-explorer-hack/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Password field as hint

2009-03-02 Thread Quleczka

Uppps, second script is not working in IE. Forget about it.

Simple solution for one password field you still have here
http://dl.getdropbox.com/u/530105/input.html.
You can also change it to add mockpassword input dynamicly in your
script.

I then tried cloning the node and replacing it, but
this loses the binding of the element to the function (it is no
longer
observed by focus or blur).  

You have to observe focus only from this newly created element - not
orginal password field... and observe blur only on orginal one, not
mocked one.

I'll work on this script later on :)

Quleczka
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Password field as hint

2009-03-02 Thread Quleczka

Version with second field added in script 
http://dl.getdropbox.com/u/530105/input2.html

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Delay Required after Ajax.Request() ... How to?

2009-03-01 Thread Quleczka

Hi,

 It does mean that if you have code further down the list of things to
 do which is reliant on the result of the request, then it will have to
 wait as well.

 So, that code would have to be part of the onSuccess too.
 Hope this is understandable.

I'm new to Ajax as well but I understand how this is working.Still I
have problem with situation described in my post above - how to take
care about this things that have to wait as well in this case? Can
you help me with this?

I have Event.observe to the form submit action with function which
should check if the value typed in the on of input fields is already
in the database or not. This function use Ajax.request to check this
and have true/false response.

How can I make this to DO NOT submit the form before ajax response
will come? ... I have all necessary processing in onSuccess but there
is no chance to execute it cause form is submitted earlier.

What is standard way to deal with this kind of things?

This is only example I have problem with. I understand basic rule of
working with Ajax and it asynchronous nature :)

Quleczka
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Delay Required after Ajax.Request() ... How to?

2009-03-01 Thread Quleczka

Hi,

Thanks for your reply.

 There are a couple of ways you can do this.

 1. Don't let them submit until the field is validated.

:

The point is I wanted to change my validation from dynamic  (when
user  type or changes the fields) to on submit only :)

 2. Do the submit via XHR rather than letting the browser do it.

Ok, I was thinking about this solution and using From.serialize but I
didn't want to my site to much - just simply change one thing -
validate username on submit not while typing :)

 One nice thing about this is that you can do most of your validation
 code just once (on the server), rather than having to have it both on
 the server (because you *always* have to validate user input on the
 server) and on the client (for your users' convenience).

You are right but I already have both so it's not a problem.

 Last but not least, the other thing that's happening latey -- which
 I've seen both good and bad examples of -- is people moving away from
 the concept of submitting forms entirely.  

Can be nice but I want entire form to submit :)

So my question is still open - is there any way to check something
with ajax request on submit and submit form when you have true/false
response?


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Delay Required after Ajax.Request() ... How to?

2009-03-01 Thread Quleczka

By the way if I don't find any other solution soon I'll use
http://prototypejs.org/api/form/request probably to send entire form
and return some result.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Delay Required after Ajax.Request() ... How to?

2009-03-01 Thread Quleczka

Hi,

 Yes. Use Event#stop to prevent default submit action. Fire an ajax
 request that does the validation. Show a validating indicator, upon
 receiving the request back, just use $('my_form_id').submit() to
 submit the form.

Thanks for hint :)

I was testing Event.stop but somehow I was thinking about it only in
context of failed validation inside my onSuccess function. I just
haven't thought about stoping even earlier before ajax request and
then just submiting form by myself.

 If you're planning to validate on submit only and on the server side, what's 
 the point in doing it with an ajax
 request ?

No I have 2 functions to run on sumbit:

- nice validation of many other fields in browser
- simple checking if username is taken by ajax request

If it is taken I don't want to submit form and reload the whole page
agan - that's all :)

Thanks a lot :)
Quleczka
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Delay Required after Ajax.Request() ... How to?

2009-03-01 Thread Quleczka

On 1 Mar, 22:38, BearState wixelb...@yahoo.com wrote:
I found out that onSuccess has little to do with
 successfully returning anything from the script.

What do you exactly mean by this?

Quleczka

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---



[Proto-Scripty] Re: Creating Ajax.InPlaceEditor dynamically ... confusing the hell out of me.

2009-03-01 Thread Quleczka

 What I found is that the fix I put in for the 'onSuccess' in
 Ajax.Request() still did not satisfactorilly allow time to return the
 value from the CGI.  Thought it did, but it didn't.

Maybe some example what exactly is not working for you in this
'onSuccess' callback?

Quleczka
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Prototype  script.aculo.us group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~--~~~~--~~--~--~---