 |
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0 |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|

June 13th, 2007, 03:26 PM
|
Authorized User
|
|
Join Date: Jul 2003
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
results in view source but not on html page
i have a recordset returned from an sql statement, my result should be a three word string, let's say, "three blind mice". when i see the results page all i am seeing in the text box (shown by value=<%=rs("naturalName")%>) is the first word, "three", but when i do a view source on the page i can see all three words.
why can i not see the remaining two words on my html page? thank you.
|

June 13th, 2007, 06:17 PM
|
Friend of Wrox
|
|
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
|
|
Iwould say you need to place single quotes around your double quotes. EG:
response.write "<textarea name='someName' rows='8'>'" & trim(RS("naturalName")) & "' </textarea>"
Next time post your code so we can see how you are rendering the textbox. Here is another way:
<textarea name="someName" rows="8"><%= trim(RS("naturalName")) %></textarea>
Eiter way will work
Wind is your friend
Matt
|

June 14th, 2007, 07:33 AM
|
Authorized User
|
|
Join Date: Jul 2003
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
thank you, I'll work with your suggestion. i'm writing my textbox like this:
<tr><td><input type="text" name="insertNaturalName" value=<%=rs("naturalName")%>></td></tr>
|

June 14th, 2007, 01:10 PM
|
Authorized User
|
|
Join Date: Jul 2003
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
okay, i'm writing the entire line dynamically using response.write, but what i don't understand is why my code is shown in my view source but not on the html page. how is this possible?
|

June 14th, 2007, 06:17 PM
|
Friend of Wrox
|
|
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
|
|
Its because you dont have quotes around your value property. Change your code to:
<tr><td><input type="text" name="insertNaturalName" value="<%=rs("naturalName")%>"></td></tr>
You should always surround tags properties with quotes. FYI If you want to be xml compliant they should be single quotes
Wind is your friend
Matt
|

June 19th, 2007, 08:37 AM
|
Authorized User
|
|
Join Date: Jul 2003
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
okay, putting tags around my variable solved the problem of cutting off a multi-word phrase, and my processing works on a pc, but, not on a mac! here is the main problem...when i select a recordset from a drop down list:
<select name="modProId">
sqlPull = "SELECT * FROM mainItems ORDER BY itemNumber desc"
Set rs = conn.execute(sqlPull)
Response.Write("<option value selected="">""</option>")
Do while not rs.EOF
Response.Write("<option value selected="& rs("itemNumber") &"> "& rs("itemNumber")&" </option>")
rs.movenext
Loop
then i check to see the value of what i am passing and write my sql select statement:
dim varTest
varTest = request.form("modProId")
Select Case varTest
Case NULL
response.write "I am NULL"
Case ""
response.write "I am an empty string"
Case else
response.write varTest
END SELECT
dim sqlSelect, modProId, pCategory, capeC
sqlSelect = "SELECT * FROM mainItems WHERE itemNumber = '"&varTest&"'"
Set rs = conn.execute(sqlSelect):
and then from this recordset i write to my form:
<td><input type="text" name="insertNaturalName" rows="12" value="<%=rs("naturalName")%>" ></td>
so...the form works fine now on a pc, and when i view the results of my CASE statement i see, on my pc, the product i've selected from my first drop down list, which in this case is, let's say...vinyl hardware, but when i use this same exact code on a mac (safari browser), the results of my CASE statement is "I am an empty string".
how can this happen just because i'm on a mac?
|

June 19th, 2007, 11:59 AM
|
Authorized User
|
|
Join Date: Jul 2003
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
btw...also does not work in safari for windows...perhaps this is a clue.
|

June 19th, 2007, 01:52 PM
|
Authorized User
|
|
Join Date: Jul 2003
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
is there anyone here that writes ASP on a mac and has encountered this problem and/or a way around this? thank you.
|

June 19th, 2007, 06:25 PM
|
Friend of Wrox
|
|
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
|
|
monstermash - ASP on a mac, very interesting.... If you dont mind me asking, how long have you been running ASP on a mac? What web server are you using, what DB are you using.
Dont take this the wrong way, I call it fitting a square peg through a round hole. Providing you have been doing this for a while, how have you found your experience?
Sorry I cant be more helpful helping with your problem however I do not have the environment to replicate and attempt to solve your issue. By the looks of things you have the MVP of the forum assisting you.
Wind is your friend
Matt
|
|
 |