Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Basics
Password Reminder
Register
| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #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.

Reply With Quote
  #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
Reply With Quote
  #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>

Reply With Quote
  #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?

Reply With Quote
  #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
Reply With Quote
  #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?


Reply With Quote
  #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.

Reply With Quote
  #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.

Reply With Quote
  #9 (permalink)  
Old June 19th, 2007, 04:23 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 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.
Reply With Quote
  #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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 07:08 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.