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

beginning form element...

<form name="form" method="post" action="processPageOutdoor.asp">
<table class="form" width="650" border="0" cellspacing="0" cellpadding="5">
<tr>


writing data...

<tr>
<td>Natural Name</td>
<td><input type="text" name="insertNaturalName" rows="12" value="<%=rs("naturalName")%>" ></td>
</tr>

<tr>
<td>Product Description </td>
<td><textarea name="insertProDesc" cols="20" rows="8"><%=rs("itemDescription")%></textarea></td>
</tr>


finishing form...

</tr>
<tr>
<td><input type="submit" name="submitUpdate" value="Submit Update"></td>
</tr>

    <input type="hidden" name="idNumber" value="<%=rs("id")%>">
    </table>
        </form>

Reply With Quote
  #12 (permalink)  
Old June 19th, 2007, 07:16 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

A couple of observations the sixth post (Posted - 06/20/2007 : 12:37:00 AM)

in relation to this code:

<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

> This is not how the code sits on the page, I can tell this from the lack of ASP delimiter tags. You should post code how it sits on the problematic page for the best help.
>Where is your closing </select> tag
>This line:
Response.Write("<option value selected="& rs("itemNumber") &"> "& rs("itemNumber")&"
What can you see wrong with it? It should be value="..." selected does not and should not be followed by an =
>You dont have a condition to check is there any records

Anyhow I will stop there, this is how I would write it:

<%
sqlPull = "SELECT * FROM mainItems ORDER BY itemNumber desc;"
Set rs = conn.execute(sqlPull)
if not rs.Eof then %>
   <select name="modProId">
    <option value="noRec">Select Item</option>
<% Do while not rs.EOF %>
      <option value="<%= rs("itemNumber") %>"><%= rs("itemNumber") %></option>
<% rs.movenext
   Loop
else
   response.write "no items found"
end if %>

Can you notice the differences? Constructivly - Poorly writen code is going to have problems in less forgiving browsers



Wind is your friend
Matt
Reply With Quote
  #13 (permalink)  
Old June 19th, 2007, 07:26 PM
Authorized User
 
Join Date: Jul 2003
Location: , , .
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i'm on a sun solaris server running unix, i'm writing scripts w/asp w/a mysql database. when i view my admin pages (which allow a user to modify product information in a database) on a pc using ie/firefox/opera i see the results of my scripts in the browser just as i should, e.g., i can select a recordset and perform an action on it, but on any browser on a mac, safari/firefox/opera/camino (also safari for windows), i can see and select a record from a drop down list, but when i select it and click submit to make changes to the record, my form comes back with no values for any of the form fields; the form thinks i'm passing an empty string instead of the intended record id.

Reply With Quote
  #14 (permalink)  
Old June 19th, 2007, 07:30 PM
Authorized User
 
Join Date: Jul 2003
Location: , , .
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i do see your point, i only posted the offending code snippet, the closing select tag is there, of course, or my code would not work.

Reply With Quote
  #15 (permalink)  
Old June 19th, 2007, 07:41 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

My main question was how long have you been running ASP on a mac?


Wind is your friend
Matt
Reply With Quote
  #16 (permalink)  
Old June 19th, 2007, 07:50 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

Maybe these 'Less forgiving' browsers dont like the form name form, try changing this.

In the problematic browser is there anything in the value="" property before its posted (the source code of course)

As I said without your envoronment its tough to tell (very few people in this forum will have your envoronment). Add to this - the code you have posted is not even how it sits on the page, near improbable.

Good luck

Wind is your friend
Matt
Reply With Quote
  #17 (permalink)  
Old June 20th, 2007, 12:34 AM
Imar's Avatar
Wrox Author
Points: 72,038, Level: 100
Points: 72,038, Level: 100 Points: 72,038, Level: 100 Points: 72,038, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,080
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

If this is really coming from the *HTML in the browser*
Code:
<tr>
<td>Natural Name</td>
<td><input type="text" name="insertNaturalName" rows="12" value="<%=rs("naturalName")%>" ></td>
</tr>

<tr>
<td>Product Description </td>
<td><textarea name="insertProDesc" cols="20" rows="8"><%=rs("itemDescription")%></textarea></td>
</tr>
then you're not running ASP at all. You're just requesting pages from the web server with an .asp extension. Notice how the asp delimiter tags are still there; they haven't been processed by the server.

Is your Unix server running Chili Soft ASP? Otherwise, I don't think you can run ASP on it. ASP runs on most Windows platforms since it's a Microsoft technology; however, for other servers you need third party software.

Since <%=rs("itemDescription")%> has not been replaced with a valid description when the page rendered from ASP to HTML, I am not really surprised that Safari is passing an empty string. What does surprise me is how other pages can work on a PC. Are they from the same server / domain?

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

my misunderstanding. not coming from the html in the browser but is my code as written in my editor. the code below is what is rendered in the browser from view source, after removing "selected" from my "option value selected" line. apparently the source of my problem...



<form name="form" method="post" action="processPageOutdoor.asp">
  <table class="form" width="650" border="0" cellspacing="0" cellpadding="5">
    <tr>
      <td><span class="style1">Update Item Outdoor</span></td>
      <td><img src="images/site/blank.gif" width="204" height="81" align="right"></td>
    </tr>
    <tr>
      <td>Product Category </td>
      <td><select name="insertProCat">
            <option>Punch Page</option>
            <option>8 Sheets</option>
                <option>Apron</option>
                <option>Bulletins</option>
                <option>Clocks</option>
        <option>Conversion</option>
        <option>Formatred</option>
        <option>GPS</option>
        <option>Hardware</option>
        <option>HOP</option>
        <option>Hurricane Frame</option>
        <option>Invisible Frame</option>
        <option>Jib Pole</option>
        <option>Kwik Zip</option>
        <option>Ladders</option>
        <option>Lighting</option>
        <option>Mobile BB</option>
        <option>Printing</option>
        <option>Paste</option>
        <option>Pole Lock</option>
        <option>Poster</option>
        <option>Safety</option>
        <option>Tri-Face</option>
        <option>Wood Pole</option>
        <option>Miscellaneous</option>
                </select></td>
    </tr>
    <tr>
      <td>Product Name</td>
      <td><input type="text" name="insertProName" value="Vinyl Hardware" ></td>
      </tr>
      <tr>
      <td>Natural Name</td>
      <td><input type="text" name="insertNaturalName" rows="12" value="" ></td>
      </tr>
      <tr>
      <td>Product Description </td>
      <td><textarea name="insertProDesc" cols="20" rows="8"></textarea></td>
      </tr>
      <tr>
      <td>Product Keywords</td>
      <td><textarea name="insertProKeywords" cols="20" rows="8"></textarea></td>
      </tr>
      <tr>
      <td>Small Product Image </td>
      <td><input type="text" input name="smallImage" size="40" value=""></td>
      </tr>
      <tr>
      <td>Top Flash </td>
      <td><input type="text" input name="topFlash" size="40" value="flashAssets/vinylTension.swf"></td>
      </tr>
      <tr>
      <td>Left Text </td>
      <td><textarea name="leftText" cols="20" rows="8">[list]<li>New stronger ribbed design</li><li>The Formetco Vinyl Tensioning Bracket is fully adjustable with the vinyl attached</li><li>Eliminates the use of ratchets on the bottom of your billboards</li><li>With our Vinyl Tensioning Bracket, copy is easily installed and released with a push or pull of a pin</li><li>Copy is pulled straight down instead of wrapping around the bottom of the boards</li><li>Eliminates nesting animals and pooling water, thus extending the life of your panels</li><li>Each Vinyl Tensioning Bracket is attached with 4 metal or wood screws per specification</li><li>Install 3 brackets per 10' to 12' gripper bar or 4 brackets per 14' gripper bar</li></ul><div id="docHolder"><div id="mainPDF"><a href="http://www.formetco.com/outdoorSite/pdf/forWeb/vinylClip.zip"><img src="http://www.formetco.com/outdoorSite/images/site/pdfLogo.gif" width="32" height="32" border="0" /></a><br><br>View<br> product info<br>sheet<br></div></div></textarea></td>
    </tr>
    <tr>
    <td>Right Flash Element </td>
    <td><input type="text" input name="rightFlashElement" size="40" value="flashAssets/rightClickHereVT.swf"></td>
    </tr>
    <tr>
    <td>Image Path (PDF)</td>
    <td><input type="text" input name="imagePathPdf" value=""></td>
    </tr>
    <tr>
    <td><input type="submit" name="submitUpdate" value="Submit Update"></td>
    <td>&nbsp;</td>
    </tr>
    <input type="hidden" name="idNumber" value="1429">
    </table>
    </form>


this is the source of the page rendered in the browser, and yes, i'm using chilisoft to run my asp scripts. not ideal but the hand i've currently been dealt until i can migrate to a windows server. ideally i'd like to learn php so i' not tied to microsoft technology. but until i learn, i use what i know best...and most of the time my asp works just as it should.

i believe my problem has been solved by removing "selected" after "option value". this has been an great learning experience and will help me find solutions for problems such as this when i encounter them again, as i'm sure i will. thank you all for all of your time and insight into my problem. this has always been an excellent forum.

i think i've answered all of your questions (running asp on mac?) but if not please let me know. thank you very much.

Reply With Quote
  #19 (permalink)  
Old June 20th, 2007, 12:14 PM
Imar's Avatar
Wrox Author
Points: 72,038, Level: 100
Points: 72,038, Level: 100 Points: 72,038, Level: 100 Points: 72,038, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,080
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Safari may be more strict when it comes to valid XHTML. This is not valid:

Response.Write("<option value selected="">""</option>")

as tt results in:

<option value selected=">"</option>

Which is incorrect (X)HTML syntax. You need something like:

<option value="" selected="selected">""</option>

which you can accomplish with:

Response.Write("<option value="""" selected=""selected"">""""</option>")

Notice how the selected attribute needs the word selected as its value. Also, to display a quote in a Response.Write statement you need to double it.

Maybe you already knew this, but it may help in diagnosing future problems.

Cheers,

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
  #20 (permalink)  
Old June 20th, 2007, 12:58 PM
Authorized User
 
Join Date: Jul 2003
Location: , , .
Posts: 38
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i agree. i'm using an html strict doctype for this site, but my code doesn't validate.... at least i don't think i'm in quirks mode. my latest project is written with a valid xhtml strict doctype, valid css and is 508 compliant, and it's been much easier to diagnose problem. thanks again for your help, much appreciated.

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 02:05 AM.


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