List Info

Thread: trouble with inner.html




trouble with inner.html
country flaguser name
United States
2008-03-13 23:55:59

Guys,

I need your help,please...
I have problem with javascript inner.html...
here is the code:

function ExpandTable()
{
s="&lt;table border=0&gt;<tr>;";
//s+=";<td bgcolor='#ffeeee' colspan=&quot;+(splitnum)+";>&lt;td colspan=&quot;
//s+=splitnum+"&gt;<;/td>&lt;/tr>&quot;;
for (i=0;i<splitnum;i++){
n++;
ya++;
cn++;
pl++;
sl++;
jd++;
//s+=";<tr><td width='254' class='tdHeadA'>Company Name"+n
s+="&lt;tr>&lt;td width='191' class='tdHeadA'>Year:</td><td width='191'>";
s+="&lt;input type='text' name='yearAttend";+ya+&quot;' />";

s+=&quot;<tr><td width='191' class='tdHeadA'>Company Name:</td><td
width='191'>&quot;
//s+=";:</td&gt;<td width='279'>";
s+="&lt;input type='text' name='compName"+cn+&quot;' />";
//s+=";<input type='text' name='compName' />";
//s+=";</td>;</tr&gt;<tr>;<td class='tdHeadA'>Position Level";+n
s+="&lt;/td>&lt;/tr><tr>&lt;td class='tdHeadA'>Position Level:</td><td>&quot;
//s+=";:</td&gt;<td&gt;"
//s+=";<input type='text' name='positionLvl' />";
s+="&lt;input type='text' name='positionLvl&quot;+pl+"' />";

s+=&quot;</td></tr><tr><td class='tdHeadA'>Salary:</td><td>";
s+="&lt;input type='text' name='salary"&#43;sl+";' />";

s+=&quot;</td></tr><tr><td class='tdHeadA'>Description of Job:</td><td>"
s+="&lt;textarea name='jobdesc"&#43;jd+&quot;' cols='60' rows='5'&gt;</textarea>&quot;

s+="<;/td><;/tr>&quot;;
}
alert(&quot;jobdesc&quot;+jd);
s+="&lt;/tr>&lt;/table&gt;";
document.getElementById("q").innerHTML=s;
}

the above function will be executed when user click the following button..

<input type=";button&quot; value=&quot;Add More Experience"
onClick=";splitnum&#43;+;ExpandTable();&quot;>

my question is:

how to insert all values into the database since the the value "jd&quot; variable
keep increasing when the user click the button...

if the user click the button 3times, then the value of "jd&quot; is 6...

I cannot insert the value of textbox whose jd value is 1,2,3,4,5....

In the database only jd0 and jd6....

Help me,please!!

[Non-text portions of this message have been removed]

__._,_.___
.

__,_._,___
Re: trouble with inner.html
country flaguser name
United States
2008-03-14 16:16:01

At 1:53 AM +0700 3/15/08, Ruth Marya wrote:
&gt;function ExpandTable()
>{
>s=&quot;<table border=0&gt;<tr>;";
>//s+=&quot;<td bgcolor='#ffeeee' colspan=&quot;+(splitnum)+";>&lt;td colspan=&quot;
>//s+=splitnum+"&amp;gt;</td><;/tr>&quot;;
>for (i=0;i<splitnum;i++){
>n++;
>ya&#43;+;
&gt;cn++;
>pl&#43;+;
>;sl++;
>jd3;+;
>[...]
>;if the user click the button 3times, then the value of "jd&quot; is 6...

At first sight, your function should reset (and, at best, define)
your counters.

Something like:

function ExpandTable()
{
var n = 0 ;
var ya = 0 ;
etc

Since you don't declare your variables they become implicit globals,
I think, with two effects: 1/ they get persistent so when you
re-enter the function they have their latest value, 2/ they are
shared with other programs.

Emmanuel
Quomodo

__._,_.___
.

__,_._,___
Re: trouble with inner.html
user name
2008-03-14 20:24:22

This might help you.

var test = jd.split;
var j0 = test[0];
var jmax = test[jd.length-1];

You can enter two different values in the database for JD or concatenate then and enter one.



Ruth Marya < ruth.marya%40gmail.com">ruth.maryagmail.com> wrote:
Guys,

I need your help,please...
I have problem with javascript inner.html...
here is the code:

function ExpandTable()
{
s="<;table border=0&gt;<tr>;";
//s+=";<td bgcolor='#ffeeee' colspan=&quot;+(splitnum)+";>&lt;td colspan=&quot;
//s+=splitnum+"&gt;</td&gt;</tr>";
for (i=0;i<splitnum;i++){
n++;
ya++;
cn++;
pl++;
sl++;
jd++;
//s+=&quot;<tr><td width='254' class='tdHeadA'>Company Name"+n
s+="<tr><td width='191' class='tdHeadA'>Year:</td><td width='191'>";
s+=&quot;<input type='text' name='yearAttend";+ya+&quot;' />";

s+=&quot;<tr><td width='191' class='tdHeadA'>Company Name:</td><td
width='191'>&quot;
//s+=":<;/td>&lt;td width='279'>";
s+=&quot;<input type='text' name='compName"+cn+&quot;' />";
//s+=&quot;<input type='text' name='compName' />";
//s+=&quot;</td></tr><tr><td class='tdHeadA'>Position Level";+n
s+="<;/td><;/tr>&lt;tr><;td class='tdHeadA'>Position Level:</td><td>&quot;
//s+=&quot;:</td><td>";
//s+=&quot;<input type='text' name='positionLvl' />";
s+=&quot;<input type='text' name='positionLvl&quot;+pl+"' />";

s+=&quot;</td></tr><tr><td class='tdHeadA'>Salary:</td><td>";
s+=&quot;<input type='text' name='salary"&#43;sl+";' />";

s+=&quot;</td></tr><tr><td class='tdHeadA'>Description of Job:</td><td>"
s+=";<textarea name='jobdesc"&#43;jd+&quot;' cols='60' rows='5'&gt;</textarea>&quot;

s+="<;/td><;/tr>&quot;;
}
alert(&quot;jobdesc&quot;+jd);
s+=&quot;</tr></table>&quot;;
document.getElementById(&quot;q";).innerHTML=s;
}

the above function will be executed when user click the following button..

<input type=";button&quot; value=&quot;Add More Experience"
onClick=";splitnum&#43;+;ExpandTable();&quot;>

my question is:

how to insert all values into the database since the the value "jd&quot; variable
keep increasing when the user click the button...

if the user click the button 3times, then the value of "jd&quot; is 6...

I cannot insert the value of textbox whose jd value is 1,2,3,4,5....

In the database only jd0 and jd6....

Help me,please!!

[Non-text portions of this message have been removed]

---------------------------------
Looking for last minute shopping deals? Find them fast with Yahoo! Search.

[Non-text portions of this message have been removed]

__._,_.___
.

__,_._,___
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )