angular-xeditable icon indicating copy to clipboard operation
angular-xeditable copied to clipboard

Inside <form> not working

Open sarath2 opened this issue 13 years ago • 90 comments

Following not working..


<form>
   <a href="#" editable-text="user.name">{{ user.name | uppercase }}</a>
</form>

sarath2 avatar Sep 08 '13 11:09 sarath2

@sarath2 if you want to have single editable element, there is no need to wrap it into form tag. If you want to have several editable elements and submit them together, you shoud wrap it into form with editable-form directive:

<form editable-form>
   <a href="#" editable-text="user.name">{{ user.name | uppercase }}</a>
</form>

vitalets avatar Sep 16 '13 10:09 vitalets

Nope. I mean, I have a form inside with varies controls. When I put one xeditable input box inside this form,it not working properly(Not shown text-box when click the link). Inside div working properly.

sarath2 avatar Sep 16 '13 18:09 sarath2

Could you make a jsfiddle to demonstrate the issue? use this as template http://jsfiddle.net/NfPcH/3

vitalets avatar Sep 19 '13 08:09 vitalets

Closing as too old. Please feel free to reopen if you still have this issue.

vitalets avatar Oct 19 '13 16:10 vitalets

hi, sorry to bring this up but i am also facing same thing, i have followed all steps in demo, when i click on an editable element nothing happens

devmondo avatar Jan 07 '14 01:01 devmondo

hi, please recheck that you added module dependency var app = angular.module("app", ["xeditable"]); If it's ok but still not working please try starter template: http://vitalets.github.io/angular-xeditable/zip/angular-xeditable-starter.zip

vitalets avatar Jan 08 '14 12:01 vitalets

vitalets,

Here's an example: http://jsfiddle.net/eJnT9/1/. In my case, I'm using a form to mainly layout the fields, however, there may be one or two values that I'd like to update in-place.

Thanks for looking into this, and let me know if you need more info.

dsidharta1 avatar Jan 21 '14 23:01 dsidharta1

Hi, vitalets:

seeing the same - clicking link on editable-text has no effect if tag is placed inside a form. created a repro using your starter template (but updated AJS to 1.2.9): http://plnkr.co/edit/NgMZ3DydXJKgddJ6gZyt?p=preview

dukehoops-zz avatar Jan 23 '14 20:01 dukehoops-zz

Hello,

I have the same problem here. I use a form to layout element cause I use a bootstrap3 theme. I understand that editable-form is mandatory for submiting the whole forms, but x-editable should work fine for simple field editing even for fields inside a form. also your angular x-editable is a great work !

lionelB avatar Jan 25 '14 13:01 lionelB

You have to explicitly call <form-name>.$show() or $form.$show() (if your form has no name attribute) for it to work.

<form editable-form>
   <a ng-click="$form.$show()" href="#" editable-text="user.name">{{ user.name | uppercase }}</a>
</form>

It won't automatically hide, either you need to call $form.$hide().

IMO, the problem here is enforcing forms with editable-* elements to have the editable-form attribute. I can think of some use cases that wont require what editable-form has to offer.

raniejade avatar Feb 04 '14 14:02 raniejade

Same issue - using <form> elements in our application to take advantage of Bootstrap 3 layout, but with editable-form declared on the form, none of my editable-text fields will open up when clicked.

Demonstrated in this plunkr: http://plnkr.co/edit/NgMZ3DydXJKgddJ6gZyt?p=preview

ryan-kimber avatar Feb 28 '14 19:02 ryan-kimber

Having the same issue, anyone have a fix?

snario avatar Jun 12 '14 18:06 snario

Here's a fix, until the library can incorporate this logic internally:

<a href="#" ng-click="$form.$show()" e-ng-blur="$form.$hide()" editable-text="model.value">{{ model.value }}</a>

thejohnfreeman avatar Jun 13 '14 15:06 thejohnfreeman

I'm using an editable-select and this does the following:

  • doesn't fix the styling issue
  • allows me to click on it and the select dropdown appears
  • doesn't allow me to save or cancel ᐧ

On Fri, Jun 13, 2014 at 11:59 AM, John Freeman [email protected] wrote:

Here's a fix, until the library can incorporate this logic internally:

{{ model.value }}

— Reply to this email directly or view it on GitHub https://github.com/vitalets/angular-xeditable/issues/6#issuecomment-46028619 .

snario avatar Jun 13 '14 16:06 snario

Mind giving a minimal example or fiddle?

thejohnfreeman avatar Jun 13 '14 17:06 thejohnfreeman

http://plnkr.co/edit/3148OUwbdxe89QRhPyTA?p=preview

Just copied the above plunker from above and moved the select inside the form and added your fix.

snario avatar Jun 13 '14 17:06 snario

It's not getting the editable-click class applied, so I'd dig in the code to see where it's failing. I'm not using the editable-select, so I don't have your problem.

thejohnfreeman avatar Jun 14 '14 04:06 thejohnfreeman

Also experiencing this problem. @thejohnfreeman's fix does not work for me.

ddasilva avatar Jun 14 '14 20:06 ddasilva

Hello I am on the same boat. Also, the workaround doesn't show the save/cancel buttons. (And particularly I am interested in getting this working with a table, or at least with the manual trigger example and I am not able to get this workaround working with this use cases).

promolic1 avatar Jun 15 '14 22:06 promolic1

Having the same problem here. As promolic1 said, the workaround doesn't show the save/cancel button, so its out. AngularJS uses "novalidate" on the form tag to enable its own validation, so it might be that xeditable and Angular's form validation are incompatible without modifying the source of angular-xeditable to ignore the form tag.

bfloydd avatar Jul 02 '14 16:07 bfloydd