Adding additional fields to form - html

I currently have this page Rahman | Khaliq | Contacts
What I am trying to do is have a guest choose yes or no, if they choose no, and click submit. I will get The answer no with their name to my email.
If they choose Yes, then I want a dropdown box to appear with numbers 1 though 10. If they choose 1, then a input box shows up so they can put the name of the guest. If they choose 2 then 2 input boxes show up, so on and so forth.
All fields should be required if they choose yes.
The submit should send me the results to my email...
Let me know your guys thoughts.
Thank you very much.

Related

Appmaker - How to enforce validation for suggest box when value is not selected from the options?

I have a form which contains a suggest box. When I click on submit one of the requirement is to not submit the form if the value is not selected from the options.
The problem occurs when we select a value and then clear it and then enter a text not chosen from the options. (Scenario quite possible as some users may not know that value is only to be chosen from the options etc)
In this case the value is still the old one and so the validation does not show any error thus creating an illusion for the user that the text which he entered is accepted as the value.
How do we restrict this?

Highlight fields in form that have been modified

I was wondering if someone can give me a general guideline or example for the following. I have created a form with several input box fields. When a user inputs something, the field highlights it orange. When a user goes to another field, the highlight goes away and the new box gets highlighted. When the user hits "save" button, the form gets saved. When the user hits "modify" button, it allows them to change the values in the fields. However, this time I would like to have the highlighted box stay highlighted on all the fields that have been changed (and obviously the fields that are not touched remain not highlighted). Is there anyway someone can send me a tutorial or create a quick example to demonstrate this? I am using Angular 1.5 and used Bootstrap to create a simple form.
Thank you
You Can use $touched property to know whether user clicked on that particular form field.
Ex:
custFrom.inputName.$touched
To know actual value modification use $dirty in the same way
Ex:
custFrom.inputName.$dirty
Please find working plunker

Is it possible to have autofocus on two input fields in the same page?

I have one form in the header of a website, and the same form in a side area (that slides out) in the same website. Is it possible to have autofocus on both input fields. When I do this, both won't show up the cursor, but when I only add it to one (the header form) it works fine. Any tips would be much appreciated.
Yes, but you need more than 2 forms in your page, and while one form is visible other one should be hidden.
E.g. User name and password are in 2 different forms. First you will enter username, check in DB whether Username is correct, then show the other form, and the password field will be visible.

Changing the style of an inputbox for memos

I am a beginner at Microsoft Access trying to creating a database and one of the fields is a memo field. I would like to request user input for that field; However, the standard inputbox has a single line for the user to enter data, and although you can use that to add large amounts of text, it is not pleasing.
I want an inputbox that accepts memos so as the user inputs a paragraph of text, he can see the entire paragraph when he submits.
How would I do it using an inputbox and not a form? Is this possible?
I am guessing you are entering the data directly into the table. If so you can simply hover over a line between two rows until you get the double arrows and click and drag. When closing the table it will ask you if you want to save your changes. if you say yes then every time after that it will appear the same when when opened. This will give you more viewing area per field. However, I do agree with HansUp, this is best controlled via a form. Here is a snapshot of a table with more room per row.
The same can be done with query results.

Having the Login & Register form in 1 page

1st question is isit ok to have more than 1 form per page? i read dunno where that 1 page shld have only 1 form, true?
assuming you do login and register form in 1 page, i think there are 2 approaches
2 separate forms -> isit ok for form input[name] to be reused? eg. both login and register will have username & passwords field
1 form. use JS to hide confirmPassword field then at server side check if there is a confirmPassword is filled? upon typing this, this does not seem like a good idea...
1st question is isit ok to have more than 1 form per page?
Yes, it's ok.
isit ok for form input[name] to be reused? eg. both login and register will have username & passwords field
Yes, it's ok. You can place two inputs with the same name (in different forms). Only 'id' attribute must be unique. You should set different actions for form. For example, the first form will be <form action='login.php'>, the second - <form action='register.php'>
1 form. use JS to hide confirmPassword field then at server side check if there is a confirmPassword is filled? upon typing this, this does not seem like a good idea...
It's better to create input with type=hidden and place action type in it:
<input type='hidden' name='action' value='login'>
You can change value with Js.
Also you can create two submit buttons in one form:
<input type='submit' name='do_login' value='Login'>
<input type='submit' name='do_register' value='Register'>
If login button pressed, the server will receive 'do_login' argument. Else, it will receive 'do_register'.
You can have as many forms as you want on a page. There's no restriction, just think about whether it makes sense or not.
If you're going to have more than 1 form, it's fine to duplicate field names if they both do the same job. But they may or may not be posting to a different location, so make sure you either do that, or include a hidden field to differentiate which form was completed.
Don't use JS to hide fields, make the form work without JavaScript if possible then enhance it with JS later.
Here's a website I used to be the webmaster for, they have an intuitive (from the UI side, anyways) way of getting people to register or login in one page:
https://www.usacycling.org/myusac/index.php?pagename=login
Note that if you register (on the left) it takes you to another (larger) registration form that gathers more specific information. This allows a good quality registration information gathering mechanism while not overwhelming the user.
It's been a while, but I believe that this example was handled with two separate forms.