...

View Full Version : Input text



Art Guy
11-18-2002, 09:07 PM
Hello All.

Quick question. Is there a way to display the contents of an input Text field before submitting it to a server. If so how?

IE: What is you name:________

After submit you would see:

Is this correct: Your name is___________ (inputted value)

Any help would be appreciated. (FYI My server does not support ASP or PHP)

Jeff

chrismiceli
11-18-2002, 10:47 PM
you could use a little javascript alert like this



<html>
<head>
</head>
<body>
<script type="text/javascript">
function valid() {
var conf = confirm("Is this your name?" + document.myForm.input0.value);
if (conf) {
//code to submit to server
}
}
</script>
<form name="myForm">
<input type="text" name="input0">
<input type="button" name="smbter" value="submit" onClick="valid()">
</body>
</html>

Art Guy
11-18-2002, 11:35 PM
I was missleading a bit there. What you sent me works perfectly.....BUT I need to be able to select the text.

This essentially does what I need....but I need to be able to Copy and Paste the displayed info. I asked it this way because I have had trouble phrasing what I need. Ok here goes:

What I am trying to do is this.

Ask a series of questions (combination of radio buttons and text fields) on a page.

I then want to hit a button that will then insert all the data supplied into several structured paragraphs on the screen. I can then cut and paste it into my client database at work. We have very structured responses we need to give at work and they take lots of time to do. This should cut the time substantially

I dont need the info submitted to be sent anywhere or stored anywhere. Just displayed that one time. Then I can refresh and start on the next client.

This wouldnt be all that complex if my server supported PHP, CGI, etc....anything. But its very basic.

any ideas? Did that make any sense at all?

JustAsking
11-18-2002, 11:57 PM
Art Guy,

From what you have explained it sounds like you really need to sort out the web server and get access to at least ASP. I believe that without some sort of server-side scripting you will not be able to achieve your goals.

Question:


Ask a series of questions (combination of radio buttons and text fields) on a page.

I then want to hit a button that will then insert all the data supplied into several structured paragraphs on the screen. I can then cut and paste it into my client database at work...

Once the user answers the questions on the form and the results (structured paragraphs) are then displayed on THEIR screen how would you intend to see the results, unless you were to pass the results to a database, or send via email? Or do you intend to fill out the form for them on your computer while on the telephone or something?

Would be sooo much easier for you in the long-term to have access to use a server-side script.

Just my thoughts anyway. :)

Richard
11-19-2002, 12:02 AM
JustAsking - you can use JavaScript.. no need for asp. I had a script ages ago to do it but i haven't got it anymore.

Art Guy
11-19-2002, 12:02 AM
Thanks for the advise. I know I havent been all that clear. Cant seem to word it correctly.

I actually got a solution from someone. It uses Java. Now I am just trying to figure out how to incorporate radio buttons into this, then I'll be set.

The code:

<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
<!--
function displayData(form) {
var name = form.name.value;
var hotel = form.hotel.value;
var add = form.add.value;
var phone = form.phone.value;
var adv = form.adv.value;
var txt = 'Dear ' + name + ',\r\n\n'
+ 'Curently you have a reservation at ' + hotel + '. They are located at ' + add
+ '. They may be reached by calling ' + phone + '.\r\n\n'
+ 'Sincerily,\r\n'
+ adv + '\r\n';
form.data.value = txt;
}
-->
</script>
</head>
<body>
<form>
Name: <input type="text" name="name"><br>
Hotel: <input type="text" name="hotel"><br>
Address: <input type="text" name="add"><br>
Phone: <input type="text" name="phone"><br>
Advisor: <input type="text" name="adv"><br>
</textarea>
<br>
<input type="button" value="Data" onClick="displayData(this.form)">
<br>
<textarea name="data" rows=12 cols=80></textarea>
</form>
</body>
</html>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum