|
-
Jun 14th, 2000, 08:54 PM
#1
Thread Starter
Addicted Member
not really a VB question, but hoping someone will know:
I have a form, which has a couple hidden fields in it.
When this form is submitted, I grab the values out of these hidden fields. Problem is that it doesn't seem to recognize multiple words (space delimited)in the hidden field.
example: I put the value "this person" into the hidden field. When I extract the value of the hidden field it returns "this" and drops person. Spaces seem to not get along with hidden fields.
This is a problem. Can anyone think of a workaround?
(I tried text-fields of "0" width, but that doesn't fly)
dvst8
-
Jun 14th, 2000, 09:09 PM
#2
Fanatic Member
I've never had this problem and I've written a tonne of web forms.
Is this ASP?
Paul Dwyer 
Network Engineer
Aussie In Tokyo
Using Powerbasic 6 & VB6 SP4 (Please also add your VB Version to your signature!)
-
Jun 14th, 2000, 09:18 PM
#3
Member
try using replace function and replace space with no space.
I do not know if my previous statement makes sense.
But you can with the use of replace function pass not "this person", but "thisperson".
hope it will help.
-
Jun 14th, 2000, 09:23 PM
#4
Junior Member
most workarounds
most workarounds for this type of problem is put the data within braces or brackets....if u cant change the input data then it could be problem becoz u wont know after how many words u have to stop like the data could be
this is the data
or
this is data
or
this data
..u see my point where do I stop replacing within the first 2 words or 3 or all 4...
but if its like this
[this is the data]
then it will solve the problem..
i have a similar search and replace for which I use the above method..
-
Jun 14th, 2000, 09:25 PM
#5
Member
brackets in asp?
i have never heard of that!!!
-
Jun 14th, 2000, 09:26 PM
#6
Fanatic Member
Got it!!!
You're using get and not post in your form!
and you're catching with Request.querystring rather than request.form.
replace you're spaces with "%20" and the space will go though.
Paul Dwyer 
Network Engineer
Aussie In Tokyo
Using Powerbasic 6 & VB6 SP4 (Please also add your VB Version to your signature!)
-
Jun 14th, 2000, 09:47 PM
#7
Thread Starter
Addicted Member
nope!
first, I am doing this in ASP...
I am using POST method and Request.form("hidden1") to retrieve data from hidden field, but it's only returning first word in space delimited string.
What I am thinking, is when I first write the data to the hidden field, just before submiting (i.e. submit_click event) I grab the value (string) contained in the hidden box, run through a function that will replace all " " with "_", and then at the other end (the page my form is submitted to) run this string through a reverse function that replaces all "_" with " ".
Viable solution? I will try it out, and let y'all know.
Is there a better solution?
Thanks
/d8/
-
Jun 14th, 2000, 10:18 PM
#8
Frenzied Member
Yuk!
dvst8 that sounds horrible!
If you do a view-source before submitting the form, is the data in the hidden field correctly?
and has it got "" round it?
-
Jun 14th, 2000, 10:18 PM
#9
Thread Starter
Addicted Member
SOLVED!
Problem solved as outlined in my previous post!
Thanks for all your help!
-
Jun 14th, 2000, 10:25 PM
#10
Thread Starter
Addicted Member
wait
sorry solution is ugly mark... i've never been much for elequence... i'm more functional!

-
Jun 14th, 2000, 10:39 PM
#11
Lively Member
Hey dvst8 i've had the same problem lately.
You see i had the nasty habit to forget to put the "" at
each side of the values so only the first word was post.
Once the "" was there everyhing was allright.
Maybe you did the same?
Just asking!
-
Jun 15th, 2000, 07:45 AM
#12
Fanatic Member
I agree with Mark!
Check the HTML source!, see if the string is intact before you submit. Something is going wrong and it would probably be a good idea to find out what before writing a lot of code that skips around the problem.
Better detected early!
If the page with the hidden field is created dynamically and that line of code is in the % % quotes make sure you use single quotes where double quotes should be.
This is not a functional vs elegance debate, There is a bug that your not fixing!
Paul Dwyer 
Network Engineer
Aussie In Tokyo
Using Powerbasic 6 & VB6 SP4 (Please also add your VB Version to your signature!)
-
Jun 15th, 2000, 07:56 PM
#13
Thread Starter
Addicted Member
DOH!
worked fine as soon as i enclosed the string with quotes
yes i know i should have done this from the start.
no need for silly replace funtions... 
thanks for help ladies and gents...
dvst8
Secret to long life:
Keep breathing as long as possible.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|