Display value of drop-down box entry selection in page

S

Scott Martin

I would like to display on the web page the defined value
associated with an entry in a drop-down box selected by
the user. I know how to build the drop-down box and
associate a value with each entry; I just don't know how
to display on the page the resulting value associated with
the entry selected by the user. Can someone help? Thanks
and I appreciate your assistance.

Best Regards,

Scott
 
M

MD WebsUnlimited.com

Hi Scott,

What is unclear is whether the drop down and page to display it on are one
in the same. I've assumed they are.

<select onchange="if (this.selectedIndex > 0 ) {
this.form.myDisplayTextBox.value = this.options[this.selectedIndex].value; }
" >

The above assumes a form
<form>
<input type="text" name="myDisplayTextBox" >
</form>

Use CSS to make it flat and borderless.
 
S

Scott

Thanks Mike - you are correct about having the drop down
and resulting display both on the same page.

I pasted the code into FP2002 but am getting an "object
required" error message. If you can help to debug the
code, I would be greatly appreciative.

<body>
<p>
<select onchange="if (this.selectedIndex > 0 ) {
this.form.myDisplayTextBox.value = this.options
[this.selectedIndex].value; }">
<option value="Banana">1</option>
<option value="Orange">2</option>
<option value="Apple">3</option>
<option value="Pear">4</option>
<option value="Peach">5</option>
</select></p>
<form>
<p><input type="text" name="myDisplayTextBox"> </p>
</form>
</body>

Also, I would like the form not to have the box around it;
if you can help me with the flat and borderless CSS I
would again be very appreciative.

Thanks,

Scott
-----Original Message-----
Hi Scott,

What is unclear is whether the drop down and page to display it on are one
in the same. I've assumed they are.

<select onchange="if (this.selectedIndex > 0 ) {
this.form.myDisplayTextBox.value = this.options [this.selectedIndex].value; }
" >

The above assumes a form
<form>
<input type="text" name="myDisplayTextBox" >
</form>

Use CSS to make it flat and borderless.

--
Mike -- FrontPage MVP '97-'02
http://www.websunlimited.com
FrontPage Add-ins Since '97 2003 / 2002 / 2000 Compatible
---------------------------------------------------------- ------------------
--------------------
If you think I'm doing a good job, let MS know at (e-mail address removed)

Scott Martin said:
I would like to display on the web page the defined value
associated with an entry in a drop-down box selected by
the user. I know how to build the drop-down box and
associate a value with each entry; I just don't know how
to display on the page the resulting value associated with
the entry selected by the user. Can someone help? Thanks
and I appreciate your assistance.

Best Regards,

Scott


.
 
M

MD WebsUnlimited.com

Hi Scott,

To you have a form nested inside of a form

<form ....>
.......
<form>
<input class="myDisplayTextBox" name="myDisplayTextBox" ....>
</form
</form>

If so you'll get the object expected rt error.

CSS
..myDisplayTextBox {border-style: none; background-color: #C0C0C0;
text-align: center;}

I appreciate your being appreciative but if you'd take a minute and write to
the address at the bottom of my sig. that would express it best.
Thank you.

--
Mike -- FrontPage MVP '97-'02
http://www.websunlimited.com
FrontPage Add-ins Since '97 2003 / 2002 / 2000 Compatible
----------------------------------------------------------------------------
--------------------
If you think I'm doing a good job, let MS know at (e-mail address removed)


Scott said:
Thanks Mike - you are correct about having the drop down
and resulting display both on the same page.

I pasted the code into FP2002 but am getting an "object
required" error message. If you can help to debug the
code, I would be greatly appreciative.

<body>
<p>
<select onchange="if (this.selectedIndex > 0 ) {
this.form.myDisplayTextBox.value = this.options
[this.selectedIndex].value; }">
<option value="Banana">1</option>
<option value="Orange">2</option>
<option value="Apple">3</option>
<option value="Pear">4</option>
<option value="Peach">5</option>
</select></p>
<form>
<p><input type="text" name="myDisplayTextBox"> </p>
</form>
</body>

Also, I would like the form not to have the box around it;
if you can help me with the flat and borderless CSS I
would again be very appreciative.

Thanks,

Scott
-----Original Message-----
Hi Scott,

What is unclear is whether the drop down and page to display it on are one
in the same. I've assumed they are.

<select onchange="if (this.selectedIndex > 0 ) {
this.form.myDisplayTextBox.value = this.options [this.selectedIndex].value; }
" >

The above assumes a form
<form>
<input type="text" name="myDisplayTextBox" >
</form>

Use CSS to make it flat and borderless.

--
Mike -- FrontPage MVP '97-'02
http://www.websunlimited.com
FrontPage Add-ins Since '97 2003 / 2002 / 2000 Compatible
---------------------------------------------------------- ------------------
--------------------
If you think I'm doing a good job, let MS know at (e-mail address removed)

Scott Martin said:
I would like to display on the web page the defined value
associated with an entry in a drop-down box selected by
the user. I know how to build the drop-down box and
associate a value with each entry; I just don't know how
to display on the page the resulting value associated with
the entry selected by the user. Can someone help? Thanks
and I appreciate your assistance.

Best Regards,

Scott


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top