Solved

Verify input

Posted on 2002-06-03
8
148 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
email validation 9 62
need help with share buttons 11 106
Clear input text 15 32
Is it obvious to anyone what on earth has happened to these page layouts - wordpress, css 5 48
This article discusses how to create an extensible mechanism for linked drop downs.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

734 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