Bug in Form with ajaxButton

101 views
Skip to first unread message

antoine no

unread,
Jul 5, 2012, 12:37:48 PM7/5/12
to Lift
Hello, i have a Form with:
2 ajaxButton
and a few input[type=text]

When i hit enter on an input[type=text] i get one of the button being "clicked" (i don't know what sort of javascript event it is).
The normal behavior is the submit button of the form being "clicked".
If i add function(event) { event.preventDefault(); } as event listener to one of the input[type=text], the form isn't submitted, the button isn't clicked as expected.
The button being triggered is always the same "tags", changing it's id don't do anything.
Changing the order of declaration of ajaxButton don't do anything, the order in the html also.

I have no more ideas.
Thank you for helping the code is bellow.

html: https://gist.github.com/3054622
snippet: https://gist.github.com/3054627

antoine no

unread,
Jul 5, 2012, 7:31:01 PM7/5/12
to Lift
The solution is the <button> need to have an attribute type speficied, by default it is submit (http://www.w3.org/wiki/HTML/Elements/button).
It takes me near 3 hours to get it, maybe more, i was too focused on javascript

2012/7/5 antoine no <antoi...@gmail.com>

Diego Medina

unread,
Jul 14, 2012, 1:44:54 AM7/14/12
to lif...@googlegroups.com
Antoine , Thanks for posting that sample code, dynamically adding
fields is what I was trying to do yesterday!

Diego
> --
> Lift, the simply functional web framework: http://liftweb.net
> Code: http://github.com/lift
> Discussion: http://groups.google.com/group/liftweb
> Stuck? Help us help you:
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code



--
Diego Medina
Lift/Scala Developer
di...@fmpwizard.com
http://www.fmpwizard.com
Reply all
Reply to author
Forward
0 new messages