Additional fields *Something Extra

Request new features, paid for or voluntary

Additional fields *Something Extra

Postby udfxrookie » Fri Apr 29, 2011 10:47 am

Wondering if this can be done... or integrated. Currently running a program where the cost of the product changes DAILY, in the additional fields I wanted to know if I could use the first line like a drop down (kind of like the credit card, where you choose either Visa/MC/Amex) but have a filed right under the first one so if you chose Visa the second field would populate with the price of the product for that day.
I.E.
Additional Field 1:Product, OPTIONS: Stock A, Stock B, Stock C
Additional Field 2:Price, OPTIONS: 300, 350, 400

So if the agent chose on their screen Stock C, the second field under that would populate with 400.

Can this be done? :D
udfxrookie
 
Posts: 69
Joined: Thu Feb 10, 2011 10:11 am

Re: Additional fields *Something Extra

Postby sentm » Fri Apr 29, 2011 7:21 pm

Actually, it can be done quite easily, you just need to know a bit of javascript...

Create the following file, with TEST being replaced with the campaign name to be validated:
/opt/osdial/html/agent/include/TEST_form_validation.js

Now, it is just a matter of writing the associated javascript for each field...

Example:
Code: Select all
// Create function to validate the product
function validate_product() {
    // Note AF# refers to the numeric field ID as stored in the database for the field.
    if (document.osdial_form.AF1.selectedIndex==0) {
        // If the 1st option is selected, select the 3rd option of AF2
        document.osdial_form.AF2.selected = 2;
    } else if (document.osdial_form.AF1.selectedIndex==1) {
        // If the 2nd option is selected, select the 1st option of AF2
        document.osdial_form.AF2.selected = 0;
    } else if (document.osdial_form.AF1.selectedIndex==2) {
        // If the 3rd option is selected, select the 2nd option of AF2
        document.osdial_form.AF2.selected = 1;
    }
}

// Assign validation function to the field.
document.osdial_form.AF1.onChange = validate_product;


While I used AF1 and AF2 in the examples above, the actual field IDs will likely be different...
sentm
 
Posts: 87
Joined: Wed May 26, 2010 10:53 pm
Location: Orlando, FL

Re: Additional fields *Something Extra

Postby udfxrookie » Fri Apr 29, 2011 9:05 pm

Your amazing!!!! Great work, thanks!!! This is going to make this the best dialer I've EVER used!!!!
udfxrookie
 
Posts: 69
Joined: Thu Feb 10, 2011 10:11 am


Return to Feature Requests

Who is online

Users browsing this forum: No registered users and 1 guest

cron