chrometweaks.org

What is the best and cheap domain and iPage web hosting ?

Click Here To View All Answers...


My question is What is the best and cheap domain and iPage web hosting ? Looking forward for any comment. My other question... I have a form which includes a select box. Each selection in the select box has two values which should be on the same line. The problem I have it how to set them up at a certain length away from one another..

<select MULTIPLE NAME="selectname" SIZE="5" style="width:470">.

<OPTION VALUE="8">8&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;18</OPTION>.

<OPTION VALUE="9">9&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;19</OPTION>.

<OPTION VALUE="10">10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;20</OPTION>.

</select>.

As you can see, I have to use a bunch of non-breaking spaces to make this look the way I want. If the values are all the same length, this will work (it's ugly, but it will work). However, this doesn't solve the problem in this case because the values are different lengths, and they will appear unaligned..

Any ideas on how to resolve this problem?..

Comments (8)

Good question... I dunno what is the answer to that question. I'll do some research and get back to you if I find an useful answer. You should email the people at iPage as they probably could assist you..

Comment #1

I did not know this from your first post..

So, the numbers are variables, so there is an easy fix..

In this instance I would use a javascript example..

Because, what you would need to do is follow the generated numbers(as variables) with generated non-breaking spaces; the number of non-breaking spaces would be decided as they are generated, with some logic. basically, the value of the first generated number becomes a variable; then, you find the value of the variable; then find the length (1 has length of 1, 10 has length of 2, 100 has length of 3 and so forth); then add non-breaking spaces as needed..

(this assumes your numbers come from an html form).

This is a simple example that gives you an idea of how to solve your problem, and you could make it more complex by putting the variables and such in arrays.....

Hope this gets you going.

John..

Comment #2

Thanks for the response. Yes, I think that is probably the way to go. Only problem, I don't really know javascript..

However, I was able to figure out (sort of) your javascript code. But, the line:.

"var num_value = document.form_name.input_name.input_value.value".

Is giving me a little bit of trouble. What specifically is "input_value"? What should I put there?.

Here is what I have so far:.

<script LANGUAGE=JAVASCRIPT>.

Var num_value = document.testform.selectname.input_value.value;.

Var num_length = num_value.length;.

If (num_length = 1){.

Num_value = num_value + "&nbsp;&nbsp;&nbsp;";.

}.

Else if (num_length = 2){.

Num_value = num_value + "&nbsp;&nbsp;";.

}.

Else if (num_length = 3){.

Num_value = num_value + "&nbsp;";.

}.

</script>.

<FORM NAME="testform">.

Name1&nbsp;&nbsp;&nbsp;&nbsp;Name2.

<BR>.

<select MULTIPLE NAME="selectname" SIZE="5" style="width:200">.

<OPTION VALUE="8">8 18</OPTION>.

<OPTION VALUE="9">9 19</OPTION>.

<OPTION VALUE="10">10 20</OPTION>.

<OPTION VALUE="10">20 30</OPTION>.

<OPTION VALUE="10">100 200</OPTION>.

</select>.

</FORM>.

BTW: Thanks so much for your help!..

Comment #3

Please explain, first, how you are going to get the numbers that will go into the select input tags? I mean, where are they coming from, what is the purpose....

Once I know this, I will help you write the script...no problems...it is slow at work today.

Cool?..

Comment #4

The numbers will come from a query. The query will be something like:.

SELECT Number1, Number2, Number3, Number4, Number5.

FROM TS.TP_SUBD.

Now, the select box will have Number1 and Number2 displayed for each line. This is where the problem comes from. Number1 could be anywhere from 1 to 5 characters (potentially even more). So, it might look something like:.

<FORM NAME="testform">.

Number1&nbsp;&nbsp;&nbsp;&nbsp;Number2.

<BR>.

<select MULTIPLE NAME="selectname" SIZE="5" style="width:200">.

<LOOP>.

<OPTION VALUE="#Number1[i]#">#Number1[i]# #Number2[i]#</OPTION>.

</LOOP>.

</select>.

</FORM>.

As you might be able to tell, Number1[i] will be all values in the database for Number1, which could be an array of characters. That is why I won't know exactly how many non-breaking spaces to use..

Does this make sense? I hope so, my explanation is probably bad. Thanks so much for you help!.

Slow at work, huh? Must be nice (just kidding).

Thanks again!..

Comment #5

I understand a little better now....

Two things:.

Where is the query taking place? on a web page? or a back end tool? and what language is this in? asp? php? a web application?.

Second, you are displaying sets of two number strings, right...do they have to be displayed in this fashion? could they be listed with check boxes?.

Basically, what you need to do is insert your logic (to parse the data, figure out the # of digits and add non-breaking spaces) in between the finished query and the displaying of the query data, right?.

I would need more info to help further, if you need it..

John..

Comment #6

I am using ColdFusion to create this. The query is being called each time this form is redrawn..

Unfortunately, they have to be displayed like this. No checkboxes or anything. Just the text string. That's it..

Any ideas on how best to do this using Javascript, or is that example you provided the best way to go (and what is 'input_value')?..

Comment #7

The facts are coming together.

So, now we both know what your problem is!.

I have consulted with a friend, and he says the javascript could work. you will have to mess with it some. it would look something like this.

And I took out 'input_value', that was a mistake..

However, and I think this is the best solution, I have been informed by another source that there is only one solution: the best solution! which is to handle the whole thing in cold fusion. supposedly it is a piece of cake..

So, definitely go to the server side scripting area of this forum to start. I haven’t worked with cold fusion, so my knowledge ends here as far as this is concerned..

I hope I helped you at least get on the right path to your solution..

Ciao and good luck.

John..

Comment #8

Ok. Thanks for the help. I will give it a try. You've been extremely helpful and patient..

I really appreciate. Have a great day!..

Comment #9


This question was taken from a support group/message board and re-posted here so others can learn from it.