Namevalues problem in dsp page

hi there,
I hva a dsp page which displays all records say

code,companyname in a table, now when i click particaular
code it shld take me to another dsp showing the current record
in two text boxes.I could do that but when am passing companyname as “IBM SERVICES” its only displaying “IBM”
why am not getting “SERVICES DISPLAYED”.is there any
function or method in dsp to handle this…

any suggestions appreciated…
thanks
GSD

Hi, Raj. Do you mind cut-and-pasting your code in a reply? I’d like to see the DSP code and also the HTML code that is generated by the DSP.

Thanks.

hi Dan ,

 the code for DSP page1 and Page2 are as below when i 

click on the hyperlink of data in table it takes me to second dsp
page where i should edit these values but am not able to
see the company name ie say if i click on code 200 with
comapnyname:“IBM SERVICES” I cld only able to view
“IBM” but not SERVICES ie if i give any space between the comapany name this probelm raises.How to handle this situation?
pls help me out

++++++++++++++++++++++++++++++
Dsp Page1

function checkPw(form)
{
var formValues=document.form.USERNAME.value+“%”
alert(formValues);
}

    %invoke ncbCompany:selectCompany% 
            <CENTER> 
 THE DETAILS OF THE COMPANY CODES ARE: 
       
    
  COMPANY CODE 
  USER NAME 
               
      
         
              %loop results% 

%value COMPANY_CODE%

                %value USERNAME% 
                
                              
        
                %endloop% 
       
     </CENTER> 

click to insert new value

%onerror%
%include Err.txt%

%endinvoke% 

++++++++++++++++++++++++++++++++++++++++++

Transactions.dsp(dsp page2)

 <FONT SIZE="+2"> Company Transaction Maintenance Screen </FONT> 
                     <PRE> 
               %value user% 
     Companycode    
     Username       
                      </PRE>

I think I have gotten to the bottom of this. The reason why you are not seeing any characters after the space in “IBM Services” is because the variable must be URL-encoded. Your browser (and everybody else’s) will interpret the " " as the end of the variable.

You can verify this by doing a “View Source…” from DSP Page 1. You will see the following: <A HREF=“/Company/Transactions.dsp?name=200&user=IBM Services” TARGET=“_top”>

So, we need to eliminate that space character. Here is one possible solution for you that uses forms and JavaScript and does not require any modifcation to your Flow.

  1. Add a form to your code right below your <BODY> tag:

<FORM ACTION = “/Company/Transactions.dsp” METHOD = “POST” NAME = “thisForm”>
<INPUT TYPE = “HIDDEN” NAME = “name”>
<INPUT TYPE = “HIDDEN” NAME = “user”>
</FORM>

We have now replaced your <A> tag with a <FORM> whose values we will populate when the form is submitted. Also, a form submitted via POST has the ENCTYPE attribute of application/x-www-form-urlencoded by default.

  1. Change your <A> tag to read:

<A HREF=“#” TARGET=“_top” onClick = “document.thisForm.name.value=‘%value COMPANY_CODE%’; document.thisForm.user.value=‘%value USERNAME%’; document.thisForm.submit();”>

Now, when a user selects a link from DSP Page 1, it will populate the HIDDEN values of the FORM and then submit the form as a POST to DSP Page 2.

Raj,

When you fetch values from database and when you are trying to go to next dsp page put the complete string into quotes.

If you put the string withing double quotes you will get the complete string in the next page even if it has spaces.

Thanks

Chris