Highlighted
New Member.
256 views

How to eliminate first value in a drop-down list

Ex: In one drop-down list have default value is "Select One"(first string), by clicking on it we will see the 10 types of products.  so here it required exclude the "select one", and pick the one product out of 10 products randomly.
Please suggest the answer to this..

0 Likes
1 Reply
Highlighted
Super Contributor.
Super Contributor.

Re: How to eliminate first value in a drop-down list

Hi, Ramu,

 Use rand()  and _idx functions to generate random index number. if the index no is 1 again genarate the idx random number.

after correlation ,correlation length is 11 (10 products and "seelct one" string) 

web_reg_save_param_ex("paramname=dropdown",---,LAST);

random:
i=rand() % lr_paramaarr_len("dropdown ") +1;
if(i==1)    
{
           goto random;
}
lr_save_string (lr_paramarr_idx ("dropdown ", i)," dropdown1");

Thanks,

Ravi

 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.