Default text in form field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I have a short form and in the form fields, I would like some text to be in
the field before they click in the field. For instance, I want the first box
to have "First Name" in the field. In the message field, I want "Please type
your message". Similar to what you see on www.burkettdental.com - Does
anyone know how to do this in Frontpage?

Thanks,
Beverly
 
Go to Text Box Properties.....
Right click on box select
"Form Field Properties"
Set the "Initial Value" to
"What ever you want in the box"

Same with Text Area

HTH
--
John Malone
==============
| Hello,
|
| I have a short form and in the form fields, I would like some text to be
in
| the field before they click in the field. For instance, I want the first
box
| to have "First Name" in the field. In the message field, I want "Please
type
| your message". Similar to what you see on www.burkettdental.com - Does
| anyone know how to do this in Frontpage?
|
| Thanks,
| Beverly
 
Now your asking,
does anyone know how to put that text in a box, but then
as you see in search forms, when you click on the box to enter text, the
standart text of for example "type your search word here" disappears and then
you are able to enter your search text...

thanx

greetz,

Barry alan
 
OK That can be done too!
Using JavaScript.

In the <head> area

Replace
</head>

with------------------------

<script language="javascript" type="text/javascript">
<!--
function clearField(object) {
object.value ="";
}
function findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document;
if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++)
x=d.forms[n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++)
x=findObj(n,d.layers.document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
//-->
</script>
</head>
=========================================
Then in the body...... you can put this (Where you want it)
=========================================

<table><td valign="top">
<table border="1" cellpadding="0" cellspacing="0" width="255">
<tr>
<td><br>
<p align="center">
<b><font size="4">Header Info Here</font></b></p>
<br>
<table width="255" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="35"></td>
<td width="179">
<form action=http://YOUR_PLACES_HERE.cvs method="post">
<table width="150" border="0" cellpadding="0" cellspacing="5">
<tr valign="top">
<td valign="middle">
<input name="contact_greeting" type="text" class="form"
onFocus="clearField(this.form.contact_greeting);" value="Your Name?"
size="24"></td>
</tr>
<tr valign="top">
<td valign="middle">
<input name="contact_email" type="text" class="form"
onFocus="clearField(this.form.contact_email);" value=" E-mail Address"
size="24"></td>
</tr>
<tr valign="top">
<td valign="middle">
<input name="contact_home_phone" type="text" class="form"
onFocus="clearField(this.form.contact_home_phone);" value=" Phone Number"
size="24"></td>
</tr>
<tr valign="top">
<td valign="middle">
<textarea name="contact_comment" cols=28 rows="7"
wrap="HARD" class="form" onFocus="clearField(this.form.contact_comment);">
Your message</textarea></td>
</tr>
<tr valign="top">
<td valign="middle">
<input type="submit" name="Submit" value="Submit" class="form">
<input type="hidden" name="formname" value="71005028"></td>
</tr>
</table>
</form></td>
</tr>
</table>
==========================
Just copy above and paste into a blank page.

Is that more like you wanted?

--
John Malone
==============
| Now your asking,
| does anyone know how to put that text in a box, but then
| as you see in search forms, when you click on the box to enter text, the
| standart text of for example "type your search word here" disappears and
then
| you are able to enter your search text...
|
| thanx
|
| greetz,
|
| Barry alan
|
| "John Malone" wrote:
|
| > Go to Text Box Properties.....
| > Right click on box select
| > "Form Field Properties"
| > Set the "Initial Value" to
| > "What ever you want in the box"
| >
| > Same with Text Area
| >
| > HTH
| > --
| > John Malone
| > ==============
message
| > | > | Hello,
| > |
| > | I have a short form and in the form fields, I would like some text to
be
| > in
| > | the field before they click in the field. For instance, I want the
first
| > box
| > | to have "First Name" in the field. In the message field, I want
"Please
| > type
| > | your message". Similar to what you see on www.burkettdental.com -
Does
| > | anyone know how to do this in Frontpage?
| > |
| > | Thanks,
| > | Beverly
| >
| >
| >
 
More Info.....
In FrontPage 2003.... (Using Behaviors)

First put the text in the "Text Box" (or Area)
==============
How?
Go to Text Box Properties.....
Right click on box select
"Form Field Properties"
Set the "Initial Value" to
"What ever you want in the box"
========================
Then highlight the box (by clicking in it (Once))
Go to behaviors panel (Insert drop down)
Then to "Set Text" then select
"Set Text of Text Field"
New Window
(The text area you have highlighted should be in the top box)
Then in the "New Text" area insert a space (nothing else)
Click OK
You can now see the new behavior in the window to the right.
In the events column (Should be onclick) use the Drop-Down
to select "onfocus"
=======================
Your done!
Preview and you should see the "default text" in the box.
When you insert the cursor (or focus) in it.... the text is gone.

8)
Have a nice Day!
--
John Malone
==============
| OK That can be done too!
| Using JavaScript.
|
| In the <head> area
|
| Replace
| </head>
|
| with------------------------
|
| <script language="javascript" type="text/javascript">
| <!--
| function clearField(object) {
| object.value ="";
| }
| function findObj(n, d) { //v4.01
| var p,i,x; if(!d) d=document;
| if((p=n.indexOf("?"))>0&&parent.frames.length) {
| d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
| if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++)
| x=d.forms[n];
| for(i=0;!x&&d.layers&&i<d.layers.length;i++)
| x=findObj(n,d.layers.document);
| if(!x && d.getElementById) x=d.getElementById(n); return x;
| }
| //-->
| </script>
| </head>
| =========================================
| Then in the body...... you can put this (Where you want it)
| =========================================
|
| <table><td valign="top">
| <table border="1" cellpadding="0" cellspacing="0" width="255">
| <tr>
| <td><br>
| <p align="center">
| <b><font size="4">Header Info Here</font></b></p>
| <br>
| <table width="255" border="0" cellspacing="0" cellpadding="0">
| <tr>
| <td width="35"></td>
| <td width="179">
| <form action=http://YOUR_PLACES_HERE.cvs method="post">
| <table width="150" border="0" cellpadding="0" cellspacing="5">
| <tr valign="top">
| <td valign="middle">
| <input name="contact_greeting" type="text" class="form"
| onFocus="clearField(this.form.contact_greeting);" value="Your Name?"
| size="24"></td>
| </tr>
| <tr valign="top">
| <td valign="middle">
| <input name="contact_email" type="text" class="form"
| onFocus="clearField(this.form.contact_email);" value=" E-mail Address"
| size="24"></td>
| </tr>
| <tr valign="top">
| <td valign="middle">
| <input name="contact_home_phone" type="text" class="form"
| onFocus="clearField(this.form.contact_home_phone);" value=" Phone Number"
| size="24"></td>
| </tr>
| <tr valign="top">
| <td valign="middle">
| <textarea name="contact_comment" cols=28 rows="7"
| wrap="HARD" class="form" onFocus="clearField(this.form.contact_comment);">
| Your message</textarea></td>
| </tr>
| <tr valign="top">
| <td valign="middle">
| <input type="submit" name="Submit" value="Submit" class="form">
| <input type="hidden" name="formname" value="71005028"></td>
| </tr>
| </table>
| </form></td>
| </tr>
| </table>
| ==========================
| Just copy above and paste into a blank page.
|
| Is that more like you wanted?
|
| --
| John Malone
| ==============
| || Now your asking,
|| does anyone know how to put that text in a box, but then
|| as you see in search forms, when you click on the box to enter text, the
|| standart text of for example "type your search word here" disappears and
| then
|| you are able to enter your search text...
||
|| thanx
||
|| greetz,
||
|| Barry alan
||
|| "John Malone" wrote:
||
|| > Go to Text Box Properties.....
|| > Right click on box select
|| > "Form Field Properties"
|| > Set the "Initial Value" to
|| > "What ever you want in the box"
|| >
|| > Same with Text Area
|| >
|| > HTH
|| > --
|| > John Malone
|| > ==============
| message
|| > || > | Hello,
|| > |
|| > | I have a short form and in the form fields, I would like some text to
| be
|| > in
|| > | the field before they click in the field. For instance, I want the
| first
|| > box
|| > | to have "First Name" in the field. In the message field, I want
| "Please
|| > type
|| > | your message". Similar to what you see on www.burkettdental.com -
| Does
|| > | anyone know how to do this in Frontpage?
|| > |
|| > | Thanks,
|| > | Beverly
|| >
|| >
|| >
|
|
 
Demo Here

http://www.xmas-i-am.com/clear_text_form_field.htm

--
John Malone
==============
| More Info.....
| In FrontPage 2003.... (Using Behaviors)
|
| First put the text in the "Text Box" (or Area)
| ==============
| How?
| Go to Text Box Properties.....
| Right click on box select
| "Form Field Properties"
| Set the "Initial Value" to
| "What ever you want in the box"
| ========================
| Then highlight the box (by clicking in it (Once))
| Go to behaviors panel (Insert drop down)
| Then to "Set Text" then select
| "Set Text of Text Field"
| New Window
| (The text area you have highlighted should be in the top box)
| Then in the "New Text" area insert a space (nothing else)
| Click OK
| You can now see the new behavior in the window to the right.
| In the events column (Should be onclick) use the Drop-Down
| to select "onfocus"
| =======================
| Your done!
| Preview and you should see the "default text" in the box.
| When you insert the cursor (or focus) in it.... the text is gone.
|
| 8)
| Have a nice Day!
| --
| John Malone
| ==============
 
Your Welcome 8)

--
John Malone
==============
| Thanks,
| It worked well!
|
| Barry Alan
|
| "John Malone" wrote:
|
| > Demo Here
| >
| > http://www.xmas-i-am.com/clear_text_form_field.htm
| >
| > --
| > John Malone
| > ==============
| > | > | More Info.....
| > | In FrontPage 2003.... (Using Behaviors)
| > |
| > | First put the text in the "Text Box" (or Area)
| > | ==============
| > | How?
| > | Go to Text Box Properties.....
| > | Right click on box select
| > | "Form Field Properties"
| > | Set the "Initial Value" to
| > | "What ever you want in the box"
| > | ========================
| > | Then highlight the box (by clicking in it (Once))
| > | Go to behaviors panel (Insert drop down)
| > | Then to "Set Text" then select
| > | "Set Text of Text Field"
| > | New Window
| > | (The text area you have highlighted should be in the top box)
| > | Then in the "New Text" area insert a space (nothing else)
| > | Click OK
| > | You can now see the new behavior in the window to the right.
| > | In the events column (Should be onclick) use the Drop-Down
| > | to select "onfocus"
| > | =======================
| > | Your done!
| > | Preview and you should see the "default text" in the box.
| > | When you insert the cursor (or focus) in it.... the text is gone.
| > |
| > | 8)
| > | Have a nice Day!
| > | --
| > | John Malone
| > | ==============
| >
| >
| >
 
Back
Top