Solved

Verify input

Posted on 2002-06-03
8
146 Views
Last Modified: 2010-04-09
I have a cgi enabled webpage that allows a user to enter data into a database. I would like to add the following ability:

When a user hits submit it echos back the input data and asks the user something like " You entered xxxx, is this correct" . A yes would submit teh data, a no would bang back to the previous page.
Thoughts
0
Comment
Question by:MatthewF
  • 3
  • 3
  • 2
8 Comments
 
LVL 18

Expert Comment

by:bruno
ID: 7051784
you want this in something like a javascript popup, or just on it's own page?


page1 submits to page2 submits to page3.


page1 has the form.  page2 grabs the info from the form, and shows whatever message you would like shown....if the user clicks "accept" page2 already has all the form values from page1 in hidden fields, and submits the form values to page3.  page3 does your processing.  

if on page2 the user clicks "no" then page1 is reloaded, either with or without the values from the form being populated back into the fields.



OR


if the data is a lot smaller (1 field??) then i think you can throw it into a javascript popup with "OK" and "CANCEL" buttons that will fire onsubmit of the form on page1.  if the user clicks ok, they are then brought to page3 which does the processing.  no more need for page2.


BRUNO
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 7051787
<FORM name='myform' action='whatever.cgi' method='post'
   onSubmit='return(confirm("You entered: " + this.myInput.value + ", is this correct?"));'>

  <INPUT name='myInput' value=''>

</form>
0
 
LVL 33

Expert Comment

by:knightEknight
ID: 7051790
Sorry Bruno, we were typing at the same time ...
also, I left out the submit button in the form:

<INPUT type='submit'>
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 18

Expert Comment

by:bruno
ID: 7051850
knight,

no worries, as i was just posting thoughts not actual code...


:-)
0
 
LVL 12

Accepted Solution

by:
lexxwern earned 75 total points
ID: 7053138
well that can be done in perl itself, /

let confirm.cgi be the file the input comes too,

this file can just show the entered data, and have another form like this ..

print qq(

..show actual data..



<form method="post" action="actual.cgi">
<input type="hidden" name="myname" value="$perlvar"/>
...so so...
...so so...
...so so...
<input type="submit" value="Confirm"/>

);


this would be more reliable as compared to non javascript browsers, and be better for you as you can avoid not learning a new thing...now is this good or bad ? ;)
0
 
LVL 12

Expert Comment

by:lexxwern
ID: 7053547
grade B ?
0
 
LVL 18

Expert Comment

by:bruno
ID: 7053648
an no feedback to anyone....
0
 
LVL 12

Expert Comment

by:lexxwern
ID: 7056992
update: Ct changed graade on request.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to make footer stick to bottom 9 36
How can I implement a "Select All" with this configuration...? 6 48
jQuery Sticky Menu 24 36
How to resize a div in html 3 35
Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question