This is a discussion on "Learning Site Question" within the Classic ASP section. This forum, and the thread "Learning Site Question are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Learning Site Question
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
Learning Site Question
Sorry to trouble you with this, but I don't know ASP very well. I have created some quizzes with Macromedia Learning Site and everything is working except for one thing. I can't get the text input from a textbox via form input to write into one column in an Access database. It writes everything that it is supposed to except the columns to the right are filled with text that should be in the previous column. I am pasting the code below. What can I change to make the textbox input stay in one column. Anytime there is more than one word entered in the textbox, it carries over to the next column. How can I tell it this is a string of data please? The textboxes (in this case) are ReceivedData(6) and ReceivedData(5).
I am having whitespace problems and I can't figure out what to insert and where. I am really desperate for an answer and your whitespace article on your wesite seemed to be the answer, but I can't seem to get it to work. If you need to look at the files, I can provide them by email. |
|
|
|
#2
|
|||
|
|||
|
You forgot to paste your code.
( I don't know the answer to your question, but I'm sure our many ASP gurus will ) |
|
#3
|
||||
|
||||
|
doesnt sound like an ugly problem.
you've probably just got the field names wrong somewhere. post a link so we can have a look
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
|
|
#4
|
|||
|
|||
|
I can't post a link to it as it lives on my laptop and our School Intranet. I can email the files to you if at all possible.
Would you consider this as an option??? I have to say, that my first impression of this forum is EXCELLENT!!! |
|
#5
|
||||
|
||||
|
Hi Barlows...
Is it possible you can paste the section of code thats throwing an error? We should sort this pretty quick at that point. Welcome to Webforumz.com!! :wink:
__________________
Click the 'Thanks!' button if this post has helped you Rob - Webforumz Founder
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
#6
|
||||
|
||||
|
I will say barlows to just make sure text field names are contained in quotes. Also, make sure values (If you set default ones) are contained in quotes too. Also, make sure that you escape apostrophes from your SQL when you do a database update / insert.
Example of a WRONG input element
When updating or inserting to the database, make sure you escape apostrophes, like this:-[code]mytextbox1 = request.form("mytextbox1") mytextbox1 = replace(mytextbox1,"'","''") mytextbox2 = request.form("mytextbox2") mytextbox2 = replace(mytextbox2,"'","''") SQL = "INSERT INTO MYTABLE (mytextbox1, mytextbox2) VALUES ('" _ & mytextbox1 & "', '" _ & mytextbox2 & "')"[/code] Hope this helps.
__________________
Click the 'Thanks!' button if this post has helped you Rob - Webforumz Founder
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
#7
|
|||
|
|||
|
Thanks for the reply Rob, it helped me understand ASP better, but did not help my problem. The problem is whitespaces.
Here is a snippet of the code that "I think" might be the problem. the section 'Build SQLString based on that data is where I think there might be a way to handle the whitespace issue. I hope this is enough to solve my problem.
|
|
#8
|
||||
|
||||
|
Hi Barlow....
What would a typical form submit be? aicc_data .... what would that contain. Also, where does the 'command' variable appear in the form? I'm just trying pin down your problem. For future referece mate, please surround chunks of code with [*code] and [*/code] (REMOVE asterisks)
__________________
Click the 'Thanks!' button if this post has helped you Rob - Webforumz Founder
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
#9
|
|||
|
|||
|
Okay, that is where it gets to be bit over my head. The aicc form data is submitted from different pages depending on the quiz that is selected. It consists of the data that is entered on the quiz such as true/false, multiple choice or text box entry. Everything works perfectly except for the text box entries. the whitespaces are getting stripped out. There are several Javascript pages that are included with each and every quiz. The other possiblity of the whitespace issue would be a Javascript issue. Here is a tiny part of the code for one of the Javascript files that appear to have somethig to do with it. I just don't know what to manipulate to keep the whitespace and text string together.
|
|
#10
|
|||
|
|||
|
I have posted a working example on a free hosting site
http://www.websamba.com/barlows The login is stu and so is the password. Additional logins are stu1, stu2, stu3 and stu4 with password matching the login. The answer to the question is "it does" (without quotations). After you answer the question, click submit and wait until the page stops processing. Then click on Finish at the top and it will send the data to the databse and display the results page where you can see what I am talking about under the User Response and Result columns. The answer "it does" should be in the User Response column and the "c" (meaning correct) should be in the result column. If you need FTP access to look at all the files let me know and I'll set it up so you can get access to all the files involved. Thanks!!! There is an error loading te page, as my frames fight witht the advertisement frame, but it does load and works just as it does on my system. |
|
#11
|
||||
|
||||
|
Hi Barlows.... I cant really see whats going on here.
Send me a private message with details to access the files, and I'll take a peek. I'm almost certain it's a javascript issue, but I can run some tests to find out.
__________________
Click the 'Thanks!' button if this post has helped you Rob - Webforumz Founder
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
#12
|
||||
|
||||
|
Hi Barlows....
This is a complete nightmare. This is one of the many Many MANY reasons NOT to use dreamweaver. It generates needless code, and ploghing your way through it takes ages. Add to that the hassle of not being able to do a global search through your code, and it's just very time consuming. You could really help me by zipping up the code and posting me the url (via private message) where i can download it from. Sorry, but I've had all I can bear from that online file manager.
__________________
Click the 'Thanks!' button if this post has helped you Rob - Webforumz Founder
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
#13
|
|||
|
|||
|
Yea, it does kind of suck, but it was free and I won't use it after this anyway. I put the zip file in the same place as the sucky file manager. The download shouldn't get to ya too much.
I wish I could offer you a beer, but I hadn't figured out how to FTP a bottle yet. Thanks |
![]() |
| Tags |
| learning, site, question |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Intranet Site - Navbar question | klonopin | Web Page Design | 7 | Mar 14th, 2007 17:53 |
| First site. 1 question. | tengu | Web Page Design | 3 | Nov 27th, 2006 21:08 |
| Question about flash site base system | Blue | Flash & Multimedia Forum | 5 | Nov 26th, 2005 21:23 |