Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Webforms Administration
#1
Hi,

Is it possible to map any leads field type in a webform to radio buttons in html? Is there any way to do it, as I do not see a radio button type in fields.

Please suggest if there is a way to do it.

thanks,
[color=#000080][b]Anil Purushothaman[/b][/color]
Reply
#2
HTML radio buttons are totally equivalent to picklist. coreBOS implements picklists and not radio buttons.
That said, it is very easy to modify your webform to use radio buttons. Let's say that you have a picklist called "sex", with values "Male" and "Female". The web form will generate html code like this:

Code:
<select name="sex">
<option value="Male">Male</option>
<option value="Female">Female</option>
</select>

which you can substitute with

Code:
<input type="radio" name="sex" value="Male">Male<br>
<input type="radio" name="sex" value="Female">Female

Note that the important part here is that the "name" attirubte use the name of the field in coreBOS

Give that a try and let us know how it goes.
Joe
TSolucio
Reply
#3
Thanks Joe, I had figured out a little later that it was a lame question <!-- sSad --><img src="{SMILIES_PATH}/icon_e_sad.gif" alt="Sad" title="Sad" /><!-- sSad -->
I was able to do it easily, like you said, by using the Name attribute.
Thanks anyways !

Anil
[color=#000080][b]Anil Purushothaman[/b][/color]
Reply
#4
<!-- sSmile --><img src="{SMILIES_PATH}/icon_e_smile.gif" alt="Smile" title="Smile" /><!-- sSmile -->
Joe
TSolucio
Reply
#5
Hi,
I am facing a problem with the html name attribute of webform fields, for example, "label:course[]" is the html name of a custom list field that i created in corebos leads module and using in webform.
How do i use this field name in the javascript code? The script doesnt work with name containing special characters.

Can you help? Thanks.

Anil
[color=#000080][b]Anil Purushothaman[/b][/color]
Reply
#6
I gave it a try and eneded up with this code:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
        <title>jstest</title>
        <script type="text/javascript" src="include/jquery/jquery-1.6.2.min.js"></script>
    </head>

    <body>
<form id='inform' name="inform">
    <input name="label;course[]" />
    <input name="label;course[]" />
    <input type="submit">
</form>
<input name="label:course[]" />
<input name="label:course[]" />
<script type="text/javascript">
$( document ).ready(function() {
    jQuery.each($("#inform :input"),function(index, elem) {
        if (elem.name=='label;course[]') {
            $(elem).val(index);
        }
    });
    jQuery.each($("input[name='label:course[]']"),function(index, elem) {
        $(elem).val(index);
    });
});
</script>
    </body>
</html>

Drop that into the root of your coreBOS install and it should work. Note how I have to change the colon for semi-colon in the name. Very strange.

My recommendation would be to use the field name: webforms should work correctly both with the "label:{label}" syntax and the "{fieldname}" syntax. So, if label:course is cf_888, both of these will work:

Code:
<input name="label:course[]" />
<input name="cf_888[]" />

that means that if you don't need to do anything with the form, the "label:{label}" syntax is fine, but if you need to do validations and the like, you may be better off using the fieldname.
Joe
TSolucio
Reply
#7
okay that means i will have to figure out the fieldnames of each custom field, like cf_888 for label:course[]. Just guessing if there is an easy list available for that, I think the email template is one place where fieldnames are used, or else i have to get into mysql tables.

thanks, I will give it a try now.
[color=#000080][b]Anil Purushothaman[/b][/color]
Reply
#8
The easiest way to find that information is on the edit screen:
  • * go to the module you have the field on
    *edit a record
    *right click on the field you want to find
    * select "inspect element"
    * that will show you the html of that field
    * look for the "name" attribute of the input element, there you will see the number assigned to your custom field
    * another way is to select the field by clicking and dragging the mouse over the input field
    * click the right button on the selected area
    * select "show selected html source"

the information is also in the vtiger_field database table.
Joe
TSolucio
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)