13 replies [Last post]
rogermakrm2006
Offline
Regular
Last seen: 14 years 52 weeks ago
Joined: 2005-08-15
Posts: 29
Points: 0

Hello helpers:

hi, i have a record set here called RSpatron which contains a record of a customer and im trying to display its name "patronName" in an asp page,

Response.write("<input type='text' name='pname' value=<%=RSpatron('patronName')%> />")

but when i try to run , IE gave me this error...

Code 800A0409 - Error Unterminated string constant error in VBScript

what can i do to fix it? ...i stucked on this one for hours...

Thanks for your help in advance!

From roger

Tags:
Anonymous
Anonymous's picture
Guru

Re: about asp database access

rogermakrm2006 wrote:
Response.write("<input type='text' name='pname' value=<%=RSpatron('patronName')%> />")
I'd like to see more of the code but I am assuming that your response.write line is enclosed in your <% and %> delimiters so I don't think that another set is going to work inside of that.

Wouldn't this be better:

dim endresult
endresult = RSpatron('patronName')
Response.write("<input type='text' name='pname' value=" & endresult & " />")

Sorry, I really haven't done ASP for about 3 or 4 years so I'm a bit rusty.

rogermakrm2006
Offline
Regular
Last seen: 14 years 52 weeks ago
Joined: 2005-08-15
Posts: 29
Points: 0

Thanks alot Triumph!

To Triumph:

Thanks alot for your help, it works now, it can be displayed! and no need sorry, i should say sorry, cause im crap at this and couldn't find this on the web or book...so strange...anyway, there is another problem...sorry about this, but this is the only place which i can be saved....

here is the problem

i have used your code:

Dim rcusname
rcusname = RSpatron("patronName")
Response.Write("<input type='text' id='Name' name='pname' value=" & rcusname & "/>")

and this works..., but in the database the value of patronName is

patronName HouseNumber EmailAddress
========= ========== ==========
Bart Simpson 12

and back in IE okay, i have used your code, and what only displayed in the textfield was: Bart and that's it...."Simpson", was missing

and also, when i used your code to display the email address, this appeared inside the textfield: /

why is that annoying slash / there? (with response.write() )

do you have any ideas from your experiences why this is happening?

Thank you very much for your help! (is my last assignment for uni, my last subject)Thanks again!

From roger

rogermakrm2006
Offline
Regular
Last seen: 14 years 52 weeks ago
Joined: 2005-08-15
Posts: 29
Points: 0

Thanks Triumph

To Triumph

Hey doo, i found out the problem and fixed it, and thank you so much for your ideas and codings...it works perfect now:

this is what i done to fix the problem i encountered before:

Dim rcusname
rcusname = RSpatron("patronName")
Response.Write("<input type='text' id='Name' name='pname' value='" & rcusname & "' size='30' maxlength='30' />")

it's amazing, now it's all fix , i just added in a quotation mark

Thanks again! and may need more help later!

From roger

Anonymous
Anonymous's picture
Guru

Re: Thanks Triumph

rogermakrm2006 wrote:
it's amazing, now it's all fix , i just added in a quotation mark
Ah, yes. I forgot the single quotes. Smile

Good going on tracking down the errors. Smile

roytheboy
roytheboy's picture
Offline
Guru
North Wales, UK
Last seen: 7 years 2 weeks ago
North Wales, UK
Timezone: GMT+1
Joined: 2004-09-18
Posts: 2233
Points: 41

Re: Thanks Triumph

Triumph wrote:
Ah, yes. I forgot the single quotes.

...but in your defence: they were missing in the first place Wink

Life's a b*tch and then you die!

Anonymous
Anonymous's picture
Guru

Re: Thanks Triumph

roytheboy wrote:
Triumph wrote:
Ah, yes. I forgot the single quotes.

...but in your defence: they were missing in the first place Wink

Thanks. Good point. Smile

rogermakrm2006
Offline
Regular
Last seen: 14 years 52 weeks ago
Joined: 2005-08-15
Posts: 29
Points: 0

problems with asp again

To helpers again:

this time, im running into matters again, got stuck on my chair for another hour.... anyway

in my rego.asp, i did this:

(part of a table in a form)
Response.Write("<td><input type='text' name='deserttotal' size='10' readonly='readonly' /></td>")

and suppose now i have a variable:

Dim total
total = 10.95

and now i want to place this "total" in the deserttotal text field i declared above (in rego.asp).

how can i do it? or is it not possible to do it?

Thank you in advance

From roger

Anonymous
Anonymous's picture
Guru

about asp database access

Dim total 
total = 10.95
Response.Write("<td><input type='text' name='deserttotal' size='10' readonly='readonly' value='" & total & "' /></td>")

Is that what you are looking for?

rogermakrm2006
Offline
Regular
Last seen: 14 years 52 weeks ago
Joined: 2005-08-15
Posts: 29
Points: 0

asp problem reply

To Triumph

Hello, thanks for your help again Laughing out loud

but below is not really what i want i think:

Dim total
total = 10.95
Response.Write("<td><input type='text' name='deserttotal' size='10' readonly='readonly' value='" & total & "' /></td>")

sorry, that i haven't express well,

Response.Write("<td><input type='text' name='deserttotal' size='10' readonly='readonly' value='" & total & "' /></td>")

the above statement is part of my form, so the total doesn't display in the deserttotal textfield until the user clicks on a checkbox (which should calculate and display total in this text field)

so, is dynamic ...the deserttotal text field should display a different total from time to time....

so, could the solution be, using your code , and when the user clicks the checkbox to calculate the total, i need to make the rego.asp refresh, so that it will display the calculated total??

but it somehow feel weird doing this, ...

Thanks for your quick help, really needed it!

From roger

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 5 years 43 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

about asp database access

To get a form value into an input, you'd need to do this:

Response.Write("<td><input type='text' name='deserttotal' size='10' readonly='readonly' value='" & request.form("deserttotal") & "' /></td>") If you are intending on the user returning to the same form as they have submitted, you may need to do a search on 'self referencing forms'.

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference

muzishun
Offline
Enthusiast
Lawrence, KS
Last seen: 13 years 1 week ago
Lawrence, KS
Timezone: GMT-6
Joined: 2005-02-08
Posts: 106
Points: 0

about asp database access

If you're wanting the form data to show up on the page dynamically without reloading the whole page, you'll have to use JavaScript.

Bill Parrott
Co-Owner and Co-Founder
Eternal Second Designs
http//www.EternalSecond.com/

rogermakrm2006
Offline
Regular
Last seen: 14 years 52 weeks ago
Joined: 2005-08-15
Posts: 29
Points: 0

going back in asp

Thanks for yours help:

now, i have the another problem....

Now let's say that the user did enter something in a field, but that it just happens to be wrong or invalid (i.e. it wasn't a properly formed email address). I can display this nice error, but whatever the user already entered in the box will be gone!

what can i do to fix this problem?

Thank you again!

From roger =D

Tyssen
Tyssen's picture
Offline
Moderator
Brisbane
Last seen: 5 years 43 weeks ago
Brisbane
Timezone: GMT+10
Joined: 2004-05-01
Posts: 8201
Points: 1386

about asp database access

If the form is sent back to itself, this

Response.Write("<td><input type='text' name='deserttotal' size='10' readonly='readonly' value='" & request.form("deserttotal") & "' /></td>") should print what they've entered back to the screen.

How to get help
Post a link. If you can't post a link, jsFiddle it.
My blog | My older articles | CSS Reference