/    Sign up×
Community /Pin to ProfileBookmark

How to forward choice field description of drop down box ?!?

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 ?

to post a comment
JavaScript

9 Comments(s)

Copy linkTweet thisAlerts:
@jackoludekauthorJan 12.2003 — 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…?

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 [email][email protected][/email] 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


?
Copy linkTweet thisAlerts:
@jackoludekauthorJan 12.2003 — 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 [URL=http://www.PCsale.co.nz/x.htm]TEST SITE[/URL]
Copy linkTweet thisAlerts:
@jackoludekauthorJan 12.2003 — Zip file - clever!

Is that or: www.PCsale.co.nz/x.htm

Greetings from New Zealand ?

[upl-file uuid=562e5495-be89-458d-9798-f33207582c11 size=9kB]x.zip[/upl-file]
Copy linkTweet thisAlerts:
@jackoludekauthorJan 12.2003 — 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
Copy linkTweet thisAlerts:
@jackoludekauthorJan 12.2003 — 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>
    Copy linkTweet thisAlerts:
    @jackoludekauthorJan 12.2003 — 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>
    Copy linkTweet thisAlerts:
    @jackoludekauthorJan 12.2003 — 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="[email protected]">



    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: [email][email protected][/email] 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="[email protected]">





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


  • To see it working please use this email: [email][email protected][/email] Password to email account is: javatesting
    Copy linkTweet thisAlerts:
    @jackoludekauthorJan 12.2003 — 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="[email protected]">

    </select>
    Copy linkTweet thisAlerts:
    @jackoludekauthorJan 12.2003 — Oh yeah, you can replace the "_" with say "Model" - i don't need the whole: "CPU, Model: Athlon XP 2700+"
    ×

    Success!

    Help @jackoludek spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 6.13,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,
    )...