Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
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
  #1 (permalink)  
Old June 13th, 2007, 03:26 PM
Authorized User
 
Join Date: Jul 2003
Location: , , .
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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.

  #2 (permalink)  
Old June 13th, 2007, 06:17 PM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

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
  #3 (permalink)  
Old June 14th, 2007, 07:33 AM
Authorized User
 
Join Date: Jul 2003
Location: , , .
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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>

  #4 (permalink)  
Old June 14th, 2007, 01:10 PM
Authorized User
 
Join Date: Jul 2003
Location: , , .
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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?

  #5 (permalink)  
Old June 14th, 2007, 06:17 PM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

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
  #6 (permalink)  
Old June 19th, 2007, 08:37 AM
Authorized User
 
Join Date: Jul 2003
Location: , , .
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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?


  #7 (permalink)  
Old June 19th, 2007, 11:59 AM
Authorized User
 
Join Date: Jul 2003
Location: , , .
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Default

btw...also does not work in safari for windows...perhaps this is a clue.

  #8 (permalink)  
Old June 19th, 2007, 01:52 PM
Authorized User
 
Join Date: Jul 2003
Location: , , .
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Default

is there anyone here that writes ASP on a mac and has encountered this problem and/or a way around this? thank you.

  #9 (permalink)  
Old June 19th, 2007, 04:23 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

How does the <form> tag look like in the final HTML in the browser?


Imar

---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
  #10 (permalink)  
Old June 19th, 2007, 06:25 PM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

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




Similar Threads
Thread Thread Starter Forum Replies Last Post
Urgent - Send mail with plain view and html view ashish.dadhwal ASP.NET 2.0 Professional 0 November 27th, 2008 01:49 AM
Disable View>Source (disable html source) kazmughal44 HTML Code Clinic 11 December 11th, 2007 11:53 AM
HTML - no View Source GreenLamar HTML Code Clinic 1 August 9th, 2007 03:19 PM
View HTML page in flash haaglin Flash (all versions) 1 January 4th, 2007 01:11 AM
View source of .aspx page not being displayed nitinp ASP.NET 2.0 Basics 5 November 7th, 2006 06:55 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.