How to enable/disable a submit button in a Webix window with proper validation message? - webix

I have a popup window which has a 'name' text field and a 'Submit' button.
I want the 'Submit' button to remain disabled until the 'name' field has some value and also show a message in the window that 'name field can not be empty to submit'.
I have made the button disable work.
However, not able to show the message and enable the 'Submit' button once the name field has value.
My snippet is here : https://webix.com/snippet/3194cb53

Please follow the below Jsfiddle link and please let me know in case you still face any issue. Please also let me know where you want to show the message (i think there is no need of msg because you are already disabling the submit button) :
https://webix.com/snippet/05ba29f2
Please find the link after adding the validation_message :
https://webix.com/snippet/29319913

Related

Angular/Bootstrap ui modal dialog with a form issue

I have an Angular JS app with a bootstrap ui modal dialogue hosting a simple edit form.
The form can be for a new "thing" or a populated "thing".
I find that when I cancel out of the modal with the form populated, submit is being called.
Any help appreciated.
Plunkr here... http://plnkr.co/edit/XhQCqlGUfcmQOhqLDeXR?p=preview
I forked your plunk and got it working here: http://plnkr.co/edit/jgg5pDQOH46XgrbW3Mvh?p=preview I think the cancel button was participating in the form submit event since it was inside the form element. Moving it outside of the form seems to have fixed the problem. I also set up the submit event to fire the modalInstance close event and the cancel event to fire the modalInstance dismiss event. This gives you the opportunity to handle things appropriately in the parent controller (ModalDemoCtrl).
EDIT
You could also stop the click event from propagating in the cancel event and still use the save as an input element inside the form tag. See this plunk for example: http://plnkr.co/edit/A81KkUUQEL3IBbOSnHQb?p=preview
I was having a similar problem. My problem was that when I clicked in the button to open the modal, my form was submited. I was using a "button" html tag, without specifying the "type" attribute. So, I found your problem and I went to the W3C documentation. I found that:
Tip: Always specify the type attribute for a button element. Different browsers use different default types for the button element. (http://www.w3schools.com/tags/tag_button.asp)
I wasn't defining the type of my button, so the default type of my browser was submit. I defined the type to "button" and everything is ok now.

Capybara + Poltergeist + Phantomjs. Unable to click a button

i have a button, upon clicking it will change the display of a div from none to block. I wanted to click on the button, have the div displayed as 'block', click "Done" and then the div's display become 'none'. Capybara was able to click on the 1st button but it couldn't seem to find the 2nd button "Done". I tried several ways:
click_on("Done")
find_button("Done").trigger('click')
find_button("Done").trigger('click')
find_link("Done").trigger('click')
I even tried to use javascript:
page.execute_script("document.getElementById('button_done').click()")
but nothing happens. I printed out the display property of the pop-up div prior to the clicking "Done" and after the clicking to check if the button was click but both statements gave me the div's property as 'block' (expected 'block' before clicking "Done" and changed to "none" after the clicking).
I allowed it to sleep(10) but doesn't seem to help.
I used the same javascript on the page console and it worked as it should be.
Any inputs?
Thanks
EDIT:
feature:
Given I click on "Create an item"
And I chose an option
Then I should be able to create an item
steps:
step "I chose an option" do
within ('#web') do
click_on "On"
end
sleep 3
#Here is where the div gets displayed with the 'Done' button
find('#button_done').click #(doesn't work though)
sleep 3
click('Create')
end
try find('selector', :visible=>false)

How to properly use radioGroup?

I have a problem regarding the implementation of my radioGroup. If I selected one of the options, and clicked the button "Apply Changes", the success message is shown, but the value that I have chosen is unselected, which seems that I haven't selected any values from my radioGroup at all. This is my code:
<cm:fieldRow required="true" label="Nature of employment" hint="" bean="${employmentInfo}" field="employmentNature.id">
<g:radioGroup name="employmentNature.id" values="${EmploymentNature.list().id}" labels="${EmploymentNature.list().title}">
${it.radio} ${it.label}<br/>
</g:radioGroup>
</cm:fieldRow>
When I haven't selected any of the values from the radioGroup, and clicked on the "Add Changes" button, the error message that I have set is not showing.Please help! Thanks!
You need to make use of the value attribute for g:radioGroup. Without a value attribute, the tag doesn't know which radio should be checked.

Dismiss the keyboard in uiwebview in case I d'ont want to submit the form

I am developing a application in phonegap. In the app, there is a page which contains two textfields and a image. No submit button because I don't want to submit the form. the desired working is as follow..
the user taps the text fields, the keyboard appears.
clicking on the image below calls a javascript(jquery method-> $.post()) function which picks the data from the textfields and send it to server(json). that means I m not submitting the form.
and the go button on the virtual keyboard is supposed to submit the form. But in my case as I m not submitting the form so go button doesn't work and it doesn't look appropriate.
I want to get rid of the button..either it may dismiss the keyboard or call the jquery function which it is not supporting.
I searched a lot over the net. I came to know that if i remove the form tag the go button changes to return button which really worked then the return button again looks dumb.
So please help me to get rid of either of the button(preferably the return button).
I don't think you will be able to get rid off the button. What you could do instead, is to have the input field in form with and onsubmit event. This event should perform the jquery $.post method and return false to prevent standard form submission. This way your go button would actually work the way user expects and you don't have to disable it.

sharepoint button Name

In SP Designer, How do I change the default text in the button. Like OK--Submit and Cancel--Go Back.
Can I change it, If yes what where does the mapping goes ..
Thank you..
You can change the text of Buttons in case of custom List Form
Right Click on OK Button select proporties
Select Indesgin as True
Change the Text to Submit
Repeat above steps for Cancel button as well

Resources