This is my first and most likely not the last question on stackoverflow. I need help, I have 2 popup windows, I need to validate data entry forms and display the text of the validation system error, but using js. Plus, you need to make the save and creat buttons so that they are not active if the form is not valid and vice versa.
I would appreciate your help!
https://codepen.io/andremoff/pen/zYLQOwN
At the moment, the error is displayed only on one popup window, the button works, but not quite correctly, since when opening the data is transferred to the form from the profile and initially they are valid, but the button is not active.
Related
I have a Java Server Face form with a few input rates, after user puts in the values and click on Save on the JSF page. The validation will happen. I want display warning messages if validation failed in a JavaScript confirmation box.
If the user insists that the updated inputs are correct then they can click on "Ok" button to save the data in the JSF page.
or
They can click on "Cancel" button to change the data in the form.
I am not sure how to have JavaScript confirmation box OK button to trigger saving operation in JSF.
Thanks in advance.
Since we are not using PrimeFace package at this point, we decided to add a button on the same page based on a specific condition. The Javascript popup does not appear to have a way to call back to the jsf with the current state.
I have created multiple optional modal pop ups. Each pop up has a form where i get user input .When i click the first submit button, i get the values, but when the user clicks on the search more details button to fill in a second or a third pop up when he clicks submit button, the forms suddenly dissappers as if it submits.
I am using Classes, i am relatively new to java script but i am feeling quite frustrated after trying this for several days now.
Someone please help.
The code is a available here
https://codesandbox.io/s/charming-sun-l4qo9?fontsize=14&hidenavigation=1&theme=dark
You should just listen for the submit event (check out the Event Reference section).
There's no submit-two or submit-three event in js.
So try getting rid of submit parameter in your ModalPopUp constructor and change the following line:
.addEventListener(this.submit, this.validate)
to:
.addEventListener('submit', this.validate)
I am having a really difficult time trying to make a request and communicate with modals from other websites. For regular html you can see the hyperlink when hovering over the link or find out all about the element when inspecting, but with modals it seems like all the code is hidden on their website somewhere, making me unable to send http get/post requests correctly.
For ex when theres a button called "View containers" it opens up a modal and then theres a textarea field and a submit button. I know the ID of the text field, but there is like zero information on the submit button or where the submit button can lead to. I want to make a script that automatically sends a request , enter in the container # and clicks submit. But I dont know how to make the script click/send submit button
First, you'd want to change the input value
You can click buttons using the DOM click method after selecting it, probably using IDs
Additionally, I'd ensure the modal was put into the DOM before trying to insert values, or press submit...modals may not be inserted to the DOM until they are triggered/loaded.
Is there a way to add a Back button which reloads a form with the inputs filled in?
I have a form with some input fields and a save (submit) button. When clicking submit, if the mandatory fields aren't filled in, a new page opens with a message. If I use the browser's Back button, I receive this message:
Confirm Form Resubmission
This webpage requires data that you entered earlier in order to be
properly displayed. You can send this data again, but by doing so you
will repeat any action this page previously performed. Press the
reload button to resubmit the data needed to load the page.
ERR_CACHE_MISS
So basically, it asks me to Refresh, and then confirm by clicking OK on a pop up window, after which the form reloads but with empty fields.
I have tried thinking of everything, but I can't find a solution. Thanks.
If it's possible, I would change the structure so that the form posts back to itself, and runs the validation of the mandatory fields. Then, if everything's ok, it will continue whatever processing is necessary. If there's a problem, it can show the form again, but in your code you will have access to the values already submitted, so you can pre-populate the form with these values and then display it to the user. It's a pretty standard design technique for this sort of thing.
Hi i want a button to be shown on all my pages.
that code should be in such a way that no form filling is needed
the text on button will be "Problem? Click Here"
when click on button, it will be pressed and the person who has clicked cannot click again unless reload the page.
After the button is clicked the mail should be sent to admin with the exact link of page where button was clicked.
there should be no form to fill.
As for example facebook like button like the content meanwhile its pressed.
What should be the code for this? Any suggestion please?
Thank you
You can use an HTML button element with an onclick javascript function linked to it.
Since you don't want the button to work again until you have reloaded the page, you will need to do this through AJAX. This means you will have to send a request to the server, where, for instance, a PHP script will retrieve the page name from a GET variable and send the email to the administrator. The javascript part can keep track of the button being clicked once or not.
That should give you some pointers on where to start with your code. However, as stated in direct comments to your question, this site is not meant for asking for coding work to be done for you. Perhaps next time, try to think of a possible solution and ask for advice on your solution (improvements, coding conventions, etc)