Validation in a modal form - css

I am updating our site that is used for our people to enter in orders. The first page gathers the customer information. The user currently clicks on a button that brings them to a secondary page where they can enter part of the customers name and it will return the correct customer code. The site is written in asp using sql.
I am trying, with html5, css and asp, to redesign the form so when the user clicks on the button, they will get a modal form where they can enter in part of the customers name. It would then return the id number and put it on the main page and close the modal form or it would return a not found error.
I have the asp code but where I am having an issue is how to load up the modal form. I can show a modal form from a page - but how should I handle the validation? The form itself is basically written in the html 5 page.
Thank you for your input.
George

If you are using jQuery then this is already supported. Each form element can have required to validate against empty input fields.
You can go further with changing the type attribute. For example this one requires email addresses:
<input type="email" required placeholder="Enter your email address" value="" />

Related

WordPress How to capture data from forms submitted by users

I want to collect data when the user fills out the form and submits the form.
Once the data is collected, I want display the submitted data on an another page in a table form.
I'm not sure how to achieve this WordPress, please guide me how this can be achieved.
Most of the data will be numeric and displayed results will be calculated.
thanks
Neil
I suppose that you use POST method in your form, and that when the user click on submit button it will go to mypage.php (or the page in action attribute of the form. Then, in that mypage.php you get the values of the form using $_POST variable.
For example if the form is
<form action="mypage.php" method="post">
<input type="text" id="mytext" name="mytext" value="write a text">
</form>
then $_POST['mytext']
will let you know the user entry.
If you used GET method instead, it's the same, but with $_GET['mytext']

ASP Disable button and run function

I want a webpage that will disable a button and run the function, after the page is refreshed the button will be re-enabled. The button are created with the method below. The problem is when I click on the button, it can disable but it wont runs the function, the page won't even refresh. No idea where the problem arise from.
set common = server.createobject("Pen_Ebizcommonproc.stringproc")
<%=common.writeButton ("Submit1","Submit","Create New Sales Contract",30,"onclick=""this.disabled=true;CheckGWidth(this.form);this.form.ContractType.value='N';""")%>
What I do mostly is extract it in a javascript function.
I remember that disabling a button cancels any following inline action of that button.
<form action="test.asp" method="post">
<input type="submit" onclick="doSomething(this);" />
<input type="text" id="ContractType" name="ContractType" />
</form>
Then in the javascript
function doSomething(sender)
{
sender.disabled=true;
CheckGWidth(sender.form);
sender.form.ContractType.value='N';
sender.form.submit();
}
Hope this is of any help.
I have had to do this a few time so that refreshing a page and revisiting a page is treated differently to one's first visit or after submitting one part of a form when there are more than one forms on a page, like when calculating updates for a shopping cart.
Depending on the scenario I used cookies to record the page loaded so that I could detect if it was the first visit, a refresh or what. If you have two buttons for things like "update" or "finish" they can use seperate forms with different hidden fields for mode=update or mode=finish.

Automated form filling for beta testing web page forms

Does anyone know of an application that I could use for Beta testing web page forms. I am looking for something that I could click a button and it will populate all the data fields with generic information. The purpose is to test a website I build to see if any errors occur by running the application and having it just fill in random information in page form with different info, symbols and characters.
You can populate the form fields using this method...
First set some values, for example...
strFirstname = "Jeff" 'temporary fill
strLastname = "Black"
Then add the value to your form field...
<input type="text" name="Firstname" value="<%= strFirstname">">
<input type="text" name="Lastname" value="<%= strLastname">">
Now you only need to click your submit button.
When you are ready to go live, simply uncomment the temporary fill values. Then they are always there for future debugging by uncommenting them.
To see at a glance the results on the next page I use something like:
response.write("Firstname = " & request("Firstname") & "<BR>"
You can use jQuery, which is a Javascript add-on (client side).
If you want to target all input fields, you can do something like this...
$("form input").val(this.attr("name"));
Running this jQuery code would populate all the input fields with the value in the Name attribute.
So the address field would populate as address, but you can change the this.attr("name") to anything else and it will populate all the fields accordingly.
Not sure if this helps, but I would think this is the fastest way to populate all the input fields. Take a look at jQuery http://www.jquery.com , I'm sure you'll find it helpful in your future in application development.

how do i make it so someone will fill out a form on my site, and then get redirected with to another form with the values already filled?

I am using a wp blog and I want leads to come in to go to be via email and then get refered to another website with the values already filled in?
I want to use php, but i will use anything that works.
does anyone know how to do this?
In HTML, when marking-up a form, you can specify default values. So for example:
<form>
<input name="firstName" value="John">
<input name="lastName" value="Doe">
<button type="submit">
</form>
So, once the user submits data from the first form, you can write the HTML in the second page with the user's information placed into the form already. By default it will be there, but it could be edited again if he/she chooses.
I don't use WP, but I'm sure you can grab the data coming from the first form, then emit the same when generating the next page.

How is this input tag linking to another page?

Response.Write("<div><input type='submit' name='submit' value='Update Cart' /></div>")
Response.Write("<div><input type='submit' name='submit' value='Shop More' /></div>")
Response.Write("<div><input type='submit' name='submit' value='Checkout' /></div>")
that is some example code from my teacher, but he hasn't answered my email in a couple days so I need some help.
When you click the Update Cart button it just updates the cart page it's on, but when you click the Shop More button it links to Shop.aspx a different page, and the Checkout links to another page as well. I can't figure out how it is linking just from that code, anybody have any insights?
Most likely either a server side redirect has occurred, or there is some Javascript which changed the form's action. Whether that was intentional or not is yet to be determined because the given code snippet doesn't give much to work with.
By checking the value of Request.Form["submit"].ToString() you can perform a conditional operation.

Resources