Reading text in a list box

S

stmartinez22

I have a few dependent list boxes set up for a real estate site. I have been working with this program a lot but still have quite a few questions. The array isn't working exactly right but I think I can figure it out. The question I have right now is this...With the 'onchange' event, can I code into the program to read what is in the text box and parse together the boxes to navigate to a web page of that name? Each choice in the text boxes is identified by just one word to make for easier coding except the first box. It contains city names, which of course, are more than 1 word. I know that a web address can't have a space so I have assigned a numeric value to each that isn't visible but is still pulled from the database using DRW. Any suggestions? Thanks.
 
J

Jim Buyens

I'm confused by these "choices" you have available in text
boxes. I'm going to presume these are actually drop-down
boxes but correct me if I'm wrong.

Anyway, to jump to another page, you replace
document.location.href with the URL you want. So, you can
certainly code:

function jump2it(){
document.location.href = "/myweb/" +
document.forms[0].box1.value +
document.forms[0].box2.value +
document.forms[0].box3.value + ".htm"
}
and then

<select name="box1" onchange="jump2it();"> ...

However, it seems to me that if the boxes are city, type
of property, and price range, and you have 10 cities, 5
types of property, and 5 price ranges, then you have 250
Web pages to construct and maintain. Are you sure about
this?

Also, you know, there's a problem with using onchange=
events on drop-down list. If the list is positioned to the
visitor's choice when the page first appears, how does the
visitor select that choice? For this reason, you might be
better off using the onclick= event on a pushbutton.

Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------



-----Original Message-----
I have a few dependent list boxes set up for a real
estate site. I have been working with this program a lot
but still have quite a few questions. The array isn't
working exactly right but I think I can figure it out.
The question I have right now is this...With
the 'onchange' event, can I code into the program to read
what is in the text box and parse together the boxes to
navigate to a web page of that name? Each choice in the
text boxes is identified by just one word to make for
easier coding except the first box. It contains city
names, which of course, are more than 1 word. I know that
a web address can't have a space so I have assigned a
numeric value to each that isn't visible but is still
pulled from the database using DRW. Any suggestions?
Thanks.
 
S

stmartinez22

I'm actually interning for a company and my boss tells me that the pages are automatically created and updated...Don't ask me how. Anyway, if I can figure out the coding that will actually produce the web site names for me that would be great. The first choice in the drop-down boxes can't be used so I'm not really concerned with whether it's onchange or onclick. Thanks

Jim Buyens said:
I'm confused by these "choices" you have available in text
boxes. I'm going to presume these are actually drop-down
boxes but correct me if I'm wrong.

Anyway, to jump to another page, you replace
document.location.href with the URL you want. So, you can
certainly code:

function jump2it(){
document.location.href = "/myweb/" +
document.forms[0].box1.value +
document.forms[0].box2.value +
document.forms[0].box3.value + ".htm"
}
and then

<select name="box1" onchange="jump2it();"> ...

However, it seems to me that if the boxes are city, type
of property, and price range, and you have 10 cities, 5
types of property, and 5 price ranges, then you have 250
Web pages to construct and maintain. Are you sure about
this?

Also, you know, there's a problem with using onchange=
events on drop-down list. If the list is positioned to the
visitor's choice when the page first appears, how does the
visitor select that choice? For this reason, you might be
better off using the onclick= event on a pushbutton.

Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------



-----Original Message-----
I have a few dependent list boxes set up for a real
estate site. I have been working with this program a lot
but still have quite a few questions. The array isn't
working exactly right but I think I can figure it out.
The question I have right now is this...With
the 'onchange' event, can I code into the program to read
what is in the text box and parse together the boxes to
navigate to a web page of that name? Each choice in the
text boxes is identified by just one word to make for
easier coding except the first box. It contains city
names, which of course, are more than 1 word. I know that
a web address can't have a space so I have assigned a
numeric value to each that isn't visible but is still
pulled from the database using DRW. Any suggestions?
Thanks.
 
J

Jim Buyens

Right. So then instead of

<option>Suburban (Less Than 1 Acre)</option>
code
<option value="1">Suburban (Less Than 1 Acre)</option>

Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------



stmartinez22 said:
Great Jim, thanks for helping me with that telephone directory problem.
Here's my new situation...

As you've seen in the threads prior to this one, I am trying to link combo
boxes together to form the URL for several .pdf's. The first drop down box
lists an area and the query also pulls up the area id, which is a number. I
would like to use that number and then the numbers assigned to each choice in
the array of the following two boxes to create the pdf file extension name.
Here's the site and here's an example.

http://www.stlmoves.com/mkteval/Market_Eval.asp

Right now, if you just click "go" it will take you to another page but not
named properly. Ideally, that page would be .../mkteval/271_0_0.pdf because
Affton is area 271, suburban is 0 in the array, and sample page is 0 in the
array. Thanks. please take a look at the source code.



stmartinez22 said:
I'm actually interning for a company and my boss tells me that the pages are automatically created and updated...Don't ask me how. Anyway, if I can figure out the coding that will actually produce the web site names for me that would be great. The first choice in the drop-down boxes can't be used so I'm not really concerned with whether it's onchange or onclick. Thanks

Jim Buyens said:
I'm confused by these "choices" you have available in text
boxes. I'm going to presume these are actually drop-down
boxes but correct me if I'm wrong.

Anyway, to jump to another page, you replace
document.location.href with the URL you want. So, you can
certainly code:

function jump2it(){
document.location.href = "/myweb/" +
document.forms[0].box1.value +
document.forms[0].box2.value +
document.forms[0].box3.value + ".htm"
}
and then

<select name="box1" onchange="jump2it();"> ...

However, it seems to me that if the boxes are city, type
of property, and price range, and you have 10 cities, 5
types of property, and 5 price ranges, then you have 250
Web pages to construct and maintain. Are you sure about
this?

Also, you know, there's a problem with using onchange=
events on drop-down list. If the list is positioned to the
visitor's choice when the page first appears, how does the
visitor select that choice? For this reason, you might be
better off using the onclick= event on a pushbutton.

Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------




-----Original Message-----
I have a few dependent list boxes set up for a real
estate site. I have been working with this program a lot
but still have quite a few questions. The array isn't
working exactly right but I think I can figure it out.
The question I have right now is this...With
the 'onchange' event, can I code into the program to read
what is in the text box and parse together the boxes to
navigate to a web page of that name? Each choice in the
text boxes is identified by just one word to make for
easier coding except the first box. It contains city
names, which of course, are more than 1 word. I know that
a web address can't have a space so I have assigned a
numeric value to each that isn't visible but is still
pulled from the database using DRW. Any suggestions?
Thanks.
.
 
Top