Results 1 to 13 of 13

Thread: Annoying HTML problem

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    142
    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

  2. #2
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Japan
    Posts
    840

    Question

    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!)

  3. #3
    Member
    Join Date
    Jan 1999
    Posts
    41
    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.

  4. #4
    Junior Member
    Join Date
    May 2000
    Posts
    27

    Smile 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..

  5. #5
    Member
    Join Date
    Jan 1999
    Posts
    41
    brackets in asp?
    i have never heard of that!!!

  6. #6
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Japan
    Posts
    840

    Lightbulb

    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!)

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    142

    Exclamation 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/

  8. #8
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845

    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?
    Mark
    -------------------

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    142

    Lightbulb SOLVED!

    Problem solved as outlined in my previous post!

    Thanks for all your help!

  10. #10

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    142

    Exclamation wait

    sorry solution is ugly mark... i've never been much for elequence... i'm more functional!



  11. #11
    Lively Member
    Join Date
    May 2000
    Posts
    67
    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!

  12. #12
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Japan
    Posts
    840

    Unhappy

    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!)

  13. #13

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    142

    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
  •  



Click Here to Expand Forum to Full Width