Click to See Complete Forum and Search --> : How to forward choice field description of drop down box ?!?


jackoludek
01-11-2003, 05:36 AM
Hi,

Could anybody advice / help me please?

Am trying to get this PC configurator code (javascript.com) to send back to me full custom PC orders - but the problem is that it can only forward numeric values of forms (pc parts prices), therefore I would still need to work out every time which price means what (PC component). Not very useful way for me to work. Is there any way that I can also pass to my email the "choice field" (the PC parts names) from every drop down box?
I would greatly appreciate any help. I have attached the page (bit messed up along the experimenting). To see it working you would need to replace my email with yours.

Cheers, Jack :confused:

jackoludek
01-11-2003, 07:15 PM
Dear Dave,
Thank you very much for your reply,
The idea accrued to me to - but I don't know Java language, hence I could not program it.
The concept has even worked to some extended (and then it stops working completely)
The code added extra empty drop down box next to my test “floppy” section but it was sending:

(…)
component_desc: Panasonic
component: 15
Floppy2:
(…)

The problem was however that calculator stopped working, the front interference did not display price no more!

Then I tried to customize the “component” into “Price” and ever since I get:

(…)
component_desc:
component: 15
Floppy2:
(…)

No description no more, and strangely enough undoing the names in code did not reverse to previous send state…:confused:

I would be good if it was sending as in version 1 and yet front face of page still work, nonetheless best would be if there was a way to get rapport like this only:

(…)
Component_description: Panasonic
Price: 15
(…)


Below is how I in complemented your code,
The page itself is uploaded with my post, also it can be accessed at: www.PCsale.co.nz/x
It will send the results to Gahan77@msn.com password is: javatesting
(but as msn tends to work slowly so the email address can be replaced on the end of pages html code)


function getDescription(sel) {
if (sel.selectedIndex < 1) return false;
var str = sel.options[sel.selectedIndex].text;
sel.form.elements[sel.name+"_desc"].value = str;
return true;
}

.
(...)
.

border=0>
<TBODY>
<TR>
<TD width="100%"><SELECT
style="BACKGROUND-COLOR: #f7f3ff"
onchange=ComputeTotal(this.form) size=1
name=Floppy0>
<input type="hidden" name="component_desc" value="">
<select size="1" name="component" onChange="return getDescription(this);">
<option value="0">choose floppy</option>
<OPTION value=10>Samsung</OPTION>
<OPTION value=15>Panasonic</OPTION>


I hope you can help,

You knowlage is much admired and appreciated

Best wishes,

Jackoludek
:cool:

jackoludek
01-11-2003, 07:25 PM
P.S: What a pitty you can not upload a .htm file!
None the less - here is the link - the site can be easly saved from there TEST SITE (http://www.PCsale.co.nz/x.htm)

jackoludek
01-11-2003, 07:34 PM
Zip file - clever!
Is that or: www.PCsale.co.nz/x.htm

Greetings from New Zealand :)

jackoludek
01-11-2003, 08:40 PM
Thank you very much for taking time to reply to me,
I have nearly zero expirence with Java / HTML
(i have dont some Basic and assembler programing on...ZX Specturm lol)

Would you be so kind as demonstrated me how and which order the code should go?
Here is our floppy example:

onchange=ComputeTotal(this.form) size=1
name=Floppy0>
<input type="" name="component_desc" value="">
<select size="1" name="component" onChange="return getDescription(this);">

<option value="0">choose floppy</option>
<OPTION value=10>Samsung</OPTION>
<OPTION value=15>Panasonic</OPTION>


Thank you,

Youre truly,
Jack

jackoludek
01-11-2003, 09:27 PM
OK

This is back working now as it did before, thougt all I did was type the code into fresh orginal code,

SADLY (very) the front price display dose not work now!!!
- so we miss the point - the configurator send nicely formated data but costumer can not work out or see price total!!

This affect every drop box down from floppy one.
We must somehow affect the caculation javascript!
Perhaps becouse it dose not return name=Floppy0> no more to calculation script - but why the other an modified drop boxes are affected too?

- IS THERE ANY WAY AROUND THIS ONE?

Please help,

onchange=ComputeTotal(this.form) size=1
name=Floppy0>
<input type="hidden" name="Component_desc" value="">

<select size="1" name="Component" onChange="return getDescription(this);">

<OPTION value=0 selected>-- Select a Floppy Drive&nbsp; --</OPTION>
<OPTION value=11>Panasonic</OPTION>
<OPTION value=15>Samsung</OPTION>
</SELECT>

jackoludek
01-11-2003, 09:45 PM
OK

This is back working now as it did before, thougt all I did was type the code into fresh orginal code,

SADLY (very) the front price display dose not work now!!!
- so we miss the point - the configurator send nicely formated data but costumer can not work out or see price total!!

This affect every drop box down from floppy one.
We must somehow affect the caculation javascript!
Perhaps becouse it dose not return name=Floppy0> no more to calculation script - but why the other an modified drop boxes are affected too?

- IS THERE ANY WAY AROUND THIS ONE?

Please help,

onchange=ComputeTotal(this.form) size=1
name=Floppy0>
<input type="hidden" name="Component_desc" value="">

<select size="1" name="Component" onChange="return getDescription(this);">

<OPTION value=0 selected>-- Select a Floppy Drive&nbsp; --</OPTION>
<OPTION value=11>Panasonic</OPTION>
<OPTION value=15>Samsung</OPTION>
</SELECT>

jackoludek
01-12-2003, 03:00 AM
Here we go again:

It's working but dose not send processor names - only price!


<SCRIPT language=JavaScript>
function ComputeTotal(form)
{CPU = form.CPU2.value = form.CPU.options[form.CPU.selectedIndex].value}

function getDescription(sel)
{if (sel.selectedIndex < 1) return false;
var str = sel.options[sel.selectedIndex].text;
sel.form.elements[sel.name+"_"].value = str;
return true;}

</SCRIPT>
<BODY>

<FORM language=JavaScript
onsubmit="return FrontPage_Form1_Validator(this)"
action=http://public.registerdirect.co.nz/cgi-bin/formmailer.cgi method=post

<TD width=""> <SELECT
onchange=ComputeTotal(this.form) size=1 name=CPU>
<OPTION value=0 selected> -- Select a Processor --</OPTION>
<OPTION value=94>Athlon XP 2200+</OPTION>
<OPTION value=184>Athlon XP 2400+</OPTION>
<OPTION value=291>Athlon XP 2700+</OPTION>
<INPUT name=CPU2>
<INPUT type=submit value="I Agree >>Submit"

<INPUT name="Latest processor pricing"> <input type="hidden" name="to" value="Gahan77@msn.com">



And now as we add two dedicated code lines - it will send processor names but the script will not display prices on screen!!!



* * * DOSE ANYBODY KNOW WHY AROUND THIS??? * * *

To see it working please use this email: gahan77@msn.com Password to email account is: javatesting



<SCRIPT language=JavaScript>
function ComputeTotal(form)
{CPU = form.CPU2.value = form.CPU.options[form.CPU.selectedIndex].value}

function getDescription(sel)
{if (sel.selectedIndex < 1) return false;
var str = sel.options[sel.selectedIndex].text;
sel.form.elements[sel.name+"_"].value = str;
return true;}

</SCRIPT>
<BODY>

<FORM language=JavaScript
onsubmit="return FrontPage_Form1_Validator(this)"
action=http://public.registerdirect.co.nz/cgi-bin/formmailer.cgi method=post

<TD width=""> <SELECT
onchange=ComputeTotal(this.form) size=1 name=CPU>



<input type="hidden" name="Processor_" value="">
<select size="1" name="Processor" onChange="return getDescription(this);">




<OPTION value=0 selected> -- Select a Processor --</OPTION>
<OPTION value=94>Athlon XP 2200+</OPTION>
<OPTION value=184>Athlon XP 2400+</OPTION>
<OPTION value=291>Athlon XP 2700+</OPTION>
<INPUT name=CPU2>
<INPUT type=submit value="I Agree >>Submit"

<INPUT name="Latest processor pricing"> <input type="hidden" name="to" value="Gahan77@msn.com">





* * * DOSE ANYBODY KNOW WHY AROUND THIS??? * * *

To see it working please use this email: gahan77@msn.com Password to email account is: javatesting

jackoludek
01-12-2003, 05:11 AM
Got it... but i just learned that Bee Gees - Gibby bro died - what this mean to us? - he had money - had doctors - was not sick - yet suddenly gone in few hours. Life is lottery - we better enjoy while we can - there are no gurantees. Rest in peace duder, el duncio etc.

The key to drop box thingy was the word .text - i knew that must be something like this but i have tried .choice and .selected - tryin guessing the javascript commands - good luck man

no special java functions needed - yet thanks dave for trying - and for the key word ovcoruse! (please forgive the polish english - is 0:09 in new zelanand)

here - simple really - and nearly perfect:

<SCRIPT language=JavaScript>
function ComputeTotal(form)
{form._.value = form.CPU.options[form.CPU.selectedIndex].text
form.Price.value = form.CPU.options[form.CPU.selectedIndex].value}
</SCRIPT>

<FORM language=JavaScript
onsubmit="return FrontPage_Form1_Validator(this)"
action=http://public.registerdirect.co.nz/cgi-bin/formmailer.cgi method=post

<TD width=""> <SELECT
onchange=ComputeTotal(this.form) size=1 type="hidden" name=CPU>

<OPTION value=0 selected> -- Select a Processor --</OPTION>
<OPTION value=94>Athlon XP 2200+</OPTION>
<OPTION value=184>Athlon XP 2400+</OPTION>
<OPTION value=291>Athlon XP 2700+</OPTION>
<INPUT type="hidden" name=_>
<INPUT name=Price>

<INPUT type=submit value="I Agree >>Submit"
<INPUT name="Latest processor pricing"><input type="hidden" name="to" value="Gahan77@msn.com">
</select>

jackoludek
01-12-2003, 05:18 AM
Oh yeah, you can replace the "_" with say "Model" - i don't need the whole: "CPU, Model: Athlon XP 2700+"