Internet Cross Logo
Internet Cross your one stop web tutorial website

Creating Forms with Components

by Anand

Creating Forms with Components

Creating forms with default components is some what simple...than before...

Let us see how it works..

1. Drag the component on stage and give a consistent instance names(FTCheckBox, FTComboBox..).

2. You can't directly use "getURL(url, window, method)" script to send variables to .asp file, instead you have to create a object(LoadVaribles) by define it as LoadVars() object.

3. This Object(LoadVariables) stores varibles name with their respective values and this can used to send value to asp or any other file

4. These conditions will check whether the value are not blank(null), and if it is true then the condition defines an initial value.

if(FTCheckBox.getValue==""){
FTCheckBox.setValue=false;
}
if(radioGroup.getValue==""){
FTCheckBox.setValue=false;
}
if(FTComboBox.getValue==""){
FTComboBox.setValue=1;
}
if(FTListBox.getSelectedIndex==""){
FTListBox.setSelectedIndex=1;
}

5. When the user click submit button it call function..

//sending data
FTPushButton.setClickHandler("onClick");
function onClick(FTPushButton){
LoadVariables = new LoadVars();
LoadVariables.Check=FTCheckBox.getValue();
LoadVariables.Radio=radioGroup.getValue();
LoadVariables.Radio=radioGroup.getValue();
LoadVariables.Combo=FTComboBox.getValue();
LoadVariables.List=FTListBox.getSelectedIndex();
getURL("asp_file.asp?"+LoadVariables, "", "GET");
}

this function store the values with variable name in the Object(LoadVariables), when this object added after .asp?+LoadVariables it is replaced with string of variables with their values

6. The output window shows the string of variables.


[Download File][Page 1]
Visit our forums to discuss / post your problems.