| Name | Type | Default |
|
padding
# |
Object
|
{ left: 5, top: 5, right: 5, bottom: 5 }
|
Gets or sets the jqxForm's padding.
<template>
<JqxForm
ref="myForm"
style="width: 450px; height: auto"
:template="template"
:value="value"
:padding="{ left: 10, top: 10, right: 10, bottom: 10 }"
/>
</template>
<script setup>
import { ref } from 'vue';
import JqxForm from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxform.vue';
const template = ref([
{
bind: 'textBoxValue',
type: 'text',
label: 'Text input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
},
{
bind: 'passwordBoxValue',
type: 'password',
label: 'Password input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
},
{
bind: 'numberBoxValue',
type: 'number',
label: 'Number input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
},
{
name: 'submitButton',
type: 'button',
text: 'Submit Form Data',
align: 'right',
padding: { left: 0, top: 5, bottom: 5, right: 40 }
}
]);
const value = ref({
textBoxValue: 'text box value',
passwordBoxValue: 'password box',
numberBoxValue: 67.44
});
function onButtonClick(event) {
alert('Button Clicked...');
}
</script>
|
|
backgroundColor
# |
String
|
#F5F5F5
|
Gets or sets the jqxForm's backgroundColor.
<template>
<JqxForm
ref="myForm"
style="width: 450px; height: auto"
:template="template"
:value="value"
:backgroundColor="'lightblue'"
/>
</template>
<script setup>
import { ref } from 'vue';
import JqxForm from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxform.vue';
const template = ref([
{
bind: 'textBoxValue',
type: 'text',
label: 'Text input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
},
{
bind: 'passwordBoxValue',
type: 'password',
label: 'Password input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
},
{
bind: 'numberBoxValue',
type: 'number',
label: 'Number input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
},
{
name: 'submitButton',
type: 'button',
text: 'Submit Form Data',
align: 'right',
padding: { left: 0, top: 5, bottom: 5, right: 40 }
}
]);
const value = ref({
textBoxValue: 'text box value',
passwordBoxValue: 'password box',
numberBoxValue: 67.44
});
function onButtonClick(event) {
alert('Button Clicked...');
}
</script>
|
|
borderColor
# |
String
|
#E5E5E5
|
Gets or sets the jqxForm's borderColor.
<template>
<JqxForm
ref="myForm"
style="width: 450px; height: auto"
:template="template"
:value="value"
:borderColor="'red'"
/>
</template>
<script setup>
import { ref } from 'vue';
import JqxForm from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxform.vue';
const template = ref([
{
bind: 'textBoxValue',
type: 'text',
label: 'Text input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
},
{
bind: 'passwordBoxValue',
type: 'password',
label: 'Password input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
},
{
bind: 'numberBoxValue',
type: 'number',
label: 'Number input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
},
{
name: 'submitButton',
type: 'button',
text: 'Submit Form Data',
align: 'right',
padding: { left: 0, top: 5, bottom: 5, right: 40 }
}
]);
const value = ref({
textBoxValue: 'text box value',
passwordBoxValue: 'password box',
numberBoxValue: 67.44
});
function onButtonClick(event) {
alert('Button Clicked...');
}
</script>
|
|
theme
# |
String
|
''
|
Sets the widget's theme.
<template>
<JqxForm ref="myForm" style="width: 450px; height: auto;"
:template="template" :value="value" :theme="'material'"
/>
</template>
<script setup>
import { ref } from "vue";
import JqxForm from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxform.vue';
const template = ref([{
bind: 'textBoxValue',
type: 'text',
label: 'Text input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
}, {
bind: 'passwordBoxValue',
type: 'password',
label: 'Password input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
}, {
bind: 'numberBoxValue',
type: 'number',
label: 'Number input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
}, {
name: 'submitButton',
type: 'button',
text: 'Submit Form Data',
align: 'right',
padding: {
left: 0,
top: 5,
bottom: 5,
right: 40
}
}]);
const value = ref({
'textBoxValue': 'text box value',
'passwordBoxValue': 'password box',
'numberBoxValue': 67.44
});
function onButtonClick(event) {
alert('Button Clicked...');
}
</script>
|
|
value
# |
Object
|
{}
|
Gets or sets the jqxForm's value.
<template>
<JqxForm ref="myForm" style="width: 450px; height: auto" :template="template" :value="value" />
</template>
<script setup>
import { ref } from 'vue';
import JqxForm from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxform.vue';
const template = ref([
{
bind: 'textBoxValue',
type: 'text',
label: 'Text input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
},
{
bind: 'passwordBoxValue',
type: 'password',
label: 'Password input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
},
{
bind: 'numberBoxValue',
type: 'number',
label: 'Number input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
},
{
name: 'submitButton',
type: 'button',
text: 'Submit Form Data',
align: 'right',
padding: { left: 0, top: 5, bottom: 5, right: 40 }
}
]);
const value = ref({
textBoxValue: 'text box value',
passwordBoxValue: 'password box',
numberBoxValue: 67.44
});
function onButtonClick(event) {
alert('Button Clicked...');
}
</script>
|
|
template
# |
Array
|
undefined
|
Gets or sets the jqxForm's template. Each object in the template, represents a Form row. Each row can have one field with label or multiple fields(if the current object's columns property is defined). Template options: - bind - Sets a template's member Name.
- type - Sets a template member's type. Possible values: 'text', 'option', 'blank', 'button', 'color', 'number', 'boolean', 'password', 'label', 'time', 'date', 'datetime', 'custom'.
- label - Sets the label displayed next to the field.
- labelWidth - Sets the with o label displayed next to the field.
- required - Sets whether the field is optional or not.
- info - Sets the field information icon's tooltip.
- infoPosition - Sets the information icon's position.
- component - Sets the component's type. 'jqxDropDownList' when type is 'option'. By default, the component type is jqxRadioButton for the 'option' type.
- options - Sets the 'option' type's options.
- init - Sets the callback function for 'custom' type initialization.
- rowHeight - Sets the row's height.
- width - Sets the row's width.
- columns - Sets the row's columns.
- align - Sets the alignment of the field. Possible values: 'right', 'center', 'left'
- valign - Sets the vertical alignment of the field. Possible values: 'top', 'center', 'bottom'
- columnWidth - Sets the column's width.
const template = [ { bind: 'firstName', type: 'text', label: 'First name', required: true, labelWidth: '80px', width: '250px', info: 'Enter first name', infoPosition: 'right' }, { bind: 'lastName', type: 'text', label: 'Last name', required: true, labelWidth: '80px', width: '250px', info: 'Enter last name' }, { bind: 'company', type: 'text', label: 'Company', required: false, labelWidth: '80px', width: '250px' }, { bind: 'address', type: 'text', label: 'Address', required: true, labelWidth: '80px', width: '250px' }, { bind: 'city', type: 'text', label: 'City', required: true, labelWidth: '80px', width: '250px' }, { bind: 'state', type: 'option', label: 'State', required: true, labelWidth: '80px', width: '250px', component: 'jqxDropDownList', options: [ { value: 'California' }, { value: 'New York'}, { value: 'Oregon'}, { value: 'Illinois'}, { value: 'Texas'} ] }, { bind: 'zip', type: 'text', label: 'Zip code', required: true, labelWidth: '80px', width: '250px' }, { type: 'blank', rowHeight: '10px' }, { columns: [ { type: 'button', text: 'Sign up', width: '90px', height: '30px', rowHeight: '40px', columnWidth: '50%', align: 'right' }, { type: 'button', text: 'Cancel', width: '90px', height: '30px', rowHeight: '40px', columnWidth: '50%' } ] } ]; var sampleValue = { firstName: 'John', lastName: 'Scott', address: '1st Ave SW', company: 'N/A', city: 'San Antonio', state: 'Texas', zip: '78209' }; $('#sampleForm').jqxForm({ template: template, value: sampleValue, backgroundColor: '#fafafa', padding: { left: 10, top: 10, right: 10, bottom: 10 } });
<template>
<JqxForm ref="myForm" style="width: 450px; height: auto" :template="template" :value="value" />
</template>
<script setup>
import { ref } from 'vue';
import JqxForm from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxform.vue';
const template = ref([
{
bind: 'textBoxValue',
type: 'text',
label: 'Text input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
},
{
bind: 'passwordBoxValue',
type: 'password',
label: 'Password input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
},
{
bind: 'numberBoxValue',
type: 'number',
label: 'Number input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
},
{
name: 'submitButton',
type: 'button',
text: 'Submit Form Data',
align: 'right',
padding: { left: 0, top: 5, bottom: 5, right: 40 }
}
]);
const value = ref({
textBoxValue: 'text box value',
passwordBoxValue: 'password box',
numberBoxValue: 67.44
});
function onButtonClick(event) {
alert('Button Clicked...');
}
</script>
|
|
enableSmartPaste
# |
Boolean
|
|
<template>
<JqxForm ref="myForm" style="width: 450px; height: auto;"
:template="template" :value="value"
/>
</template>
<script setup>
import { ref } from "vue";
import JqxForm from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxform.vue';
const template = ref([{
bind: 'textBoxValue',
type: 'text',
label: 'Text input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
}, {
bind: 'passwordBoxValue',
type: 'password',
label: 'Password input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
}, {
bind: 'numberBoxValue',
type: 'number',
label: 'Number input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
}, {
name: 'submitButton',
type: 'button',
text: 'Submit Form Data',
align: 'right',
padding: {
left: 0,
top: 5,
bottom: 5,
right: 40
}
}]);
const value = ref({
'textBoxValue': 'text box value',
'passwordBoxValue': 'password box',
'numberBoxValue': 67.44
});
function onButtonClick(event) {
alert('Button Clicked...');
}
</script>
|
|
aiKey
# |
String
|
|
<template>
<JqxForm ref="myForm" style="width: 450px; height: auto;"
:template="template" :value="value"
/>
</template>
<script setup>
import { ref } from "vue";
import JqxForm from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxform.vue';
const template = ref([{
bind: 'textBoxValue',
type: 'text',
label: 'Text input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
}, {
bind: 'passwordBoxValue',
type: 'password',
label: 'Password input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
}, {
bind: 'numberBoxValue',
type: 'number',
label: 'Number input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
}, {
name: 'submitButton',
type: 'button',
text: 'Submit Form Data',
align: 'right',
padding: {
left: 0,
top: 5,
bottom: 5,
right: 40
}
}]);
const value = ref({
'textBoxValue': 'text box value',
'passwordBoxValue': 'password box',
'numberBoxValue': 67.44
});
function onButtonClick(event) {
alert('Button Clicked...');
}
</script>
|
|
aiUrl
# |
String
|
|
<template>
<JqxForm ref="myForm" style="width: 450px; height: auto;"
:template="template" :value="value"
/>
</template>
<script setup>
import { ref } from "vue";
import JqxForm from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxform.vue';
const template = ref([{
bind: 'textBoxValue',
type: 'text',
label: 'Text input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
}, {
bind: 'passwordBoxValue',
type: 'password',
label: 'Password input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
}, {
bind: 'numberBoxValue',
type: 'number',
label: 'Number input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
}, {
name: 'submitButton',
type: 'button',
text: 'Submit Form Data',
align: 'right',
padding: {
left: 0,
top: 5,
bottom: 5,
right: 40
}
}]);
const value = ref({
'textBoxValue': 'text box value',
'passwordBoxValue': 'password box',
'numberBoxValue': 67.44
});
function onButtonClick(event) {
alert('Button Clicked...');
}
</script>
|
|
|
|
formDataChange
# |
Event
|
|
Event: formDataChange
Code examples #
Bind to the formDataChange event of jqxForm.
<template>
<JqxForm
ref="myForm"
@formDataChange="onFormDataChange($event)"
style="width: 450px; height: auto"
:template="template"
:value="value"
/>
</template>
<script setup>
import { ref } from 'vue';
import JqxForm from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxform.vue';
const template = ref([
{
bind: 'textBoxValue',
type: 'text',
label: 'Text input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
},
{
bind: 'passwordBoxValue',
type: 'password',
label: 'Password input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
},
{
bind: 'numberBoxValue',
type: 'number',
label: 'Number input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
},
{
name: 'submitButton',
type: 'button',
text: 'Submit Form Data',
align: 'right',
padding: { left: 0, top: 5, bottom: 5, right: 40 }
}
]);
const value = ref({
textBoxValue: 'text box value',
passwordBoxValue: 'password box',
numberBoxValue: 67.44
});
function onButtonClick(event) {
alert('Button Clicked...');
}
function onFormDataChange(event) {
alert('do something...');
}
</script>
|
|
buttonClick
# |
Event
|
|
Event: buttonClick
Code examples #
Bind to the buttonClick event of jqxForm.
<template>
<JqxForm
ref="myForm"
@buttonClick="onButtonClick($event)"
style="width: 450px; height: auto"
:template="template"
:value="value"
/>
</template>
<script setup>
import { ref } from 'vue';
import JqxForm from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxform.vue';
const template = ref([
{
bind: 'textBoxValue',
type: 'text',
label: 'Text input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
},
{
bind: 'passwordBoxValue',
type: 'password',
label: 'Password input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
},
{
bind: 'numberBoxValue',
type: 'number',
label: 'Number input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
},
{
name: 'submitButton',
type: 'button',
text: 'Submit Form Data',
align: 'right',
padding: { left: 0, top: 5, bottom: 5, right: 40 }
}
]);
const value = ref({
textBoxValue: 'text box value',
passwordBoxValue: 'password box',
numberBoxValue: 67.44
});
function onButtonClick(event) {
alert('do something...');
}
</script>
|
|
|
| Name | Arguments | Return Type |
|
getInstance
# |
|
Object
|
Method: getInstance
<template>
<JqxForm ref="myForm" style="width: 450px; height: auto" :template="template" :value="value" />
</template>
<script setup>
import { onMounted, ref } from 'vue';
import JqxForm from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxform.vue';
const myForm = ref(null);
const template = ref([
{
bind: 'textBoxValue',
type: 'text',
label: 'Text input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
},
{
bind: 'passwordBoxValue',
type: 'password',
label: 'Password input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
},
{
bind: 'numberBoxValue',
type: 'number',
label: 'Number input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
},
{
name: 'submitButton',
type: 'button',
text: 'Submit Form Data',
align: 'right',
padding: { left: 0, top: 5, bottom: 5, right: 40 }
}
]);
const value = ref({
textBoxValue: 'text box value',
passwordBoxValue: 'password box',
numberBoxValue: 67.44
});
function onButtonClick(event) {
alert('Button Clicked...');
}
onMounted(() => {
const value = myForm.value.getInstance();
});
</script>
|
|
refresh
# |
|
None
|
Refreshes the Form Component
<template>
<JqxForm ref="myForm" style="width: 450px; height: auto" :template="template" :value="value" />
</template>
<script setup>
import { onMounted, ref } from 'vue';
import JqxForm from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxform.vue';
const myForm = ref(null);
const template = ref([
{
bind: 'textBoxValue',
type: 'text',
label: 'Text input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
},
{
bind: 'passwordBoxValue',
type: 'password',
label: 'Password input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
},
{
bind: 'numberBoxValue',
type: 'number',
label: 'Number input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
},
{
name: 'submitButton',
type: 'button',
text: 'Submit Form Data',
align: 'right',
padding: { left: 0, top: 5, bottom: 5, right: 40 }
}
]);
const value = ref({
textBoxValue: 'text box value',
passwordBoxValue: 'password box',
numberBoxValue: 67.44
});
function onButtonClick(event) {
alert('Button Clicked...');
}
onMounted(() => {
myForm.value.refresh();
});
</script>
|
|
destroy
# |
|
None
|
Destroys the Form Component
<template>
<JqxForm ref="myForm" style="width: 450px; height: auto" :template="template" :value="value" />
</template>
<script setup>
import { onMounted, ref } from 'vue';
import JqxForm from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxform.vue';
const myForm = ref(null);
const template = ref([
{
bind: 'textBoxValue',
type: 'text',
label: 'Text input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
},
{
bind: 'passwordBoxValue',
type: 'password',
label: 'Password input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
},
{
bind: 'numberBoxValue',
type: 'number',
label: 'Number input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
},
{
name: 'submitButton',
type: 'button',
text: 'Submit Form Data',
align: 'right',
padding: { left: 0, top: 5, bottom: 5, right: 40 }
}
]);
const value = ref({
textBoxValue: 'text box value',
passwordBoxValue: 'password box',
numberBoxValue: 67.44
});
function onButtonClick(event) {
alert('Button Clicked...');
}
onMounted(() => {
myForm.value.destroy();
});
</script>
|
|
hideComponent
# |
name
|
None
|
Hides a form element component from the list specified in the template .
<template>
<JqxForm ref="myForm" style="width: 450px; height: auto" :template="template" :value="value" />
</template>
<script setup>
import { onMounted, ref } from 'vue';
import JqxForm from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxform.vue';
const myForm = ref(null);
const template = ref([
{
bind: 'textBoxValue',
type: 'text',
label: 'Text input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
},
{
bind: 'passwordBoxValue',
type: 'password',
label: 'Password input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
},
{
bind: 'numberBoxValue',
type: 'number',
label: 'Number input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
},
{
name: 'submitButton',
type: 'button',
text: 'Submit Form Data',
align: 'right',
padding: { left: 0, top: 5, bottom: 5, right: 40 }
}
]);
const value = ref({
textBoxValue: 'text box value',
passwordBoxValue: 'password box',
numberBoxValue: 67.44
});
function onButtonClick(event) {
alert('Button Clicked...');
}
onMounted(() => {
myForm.value.hideComponent('submitButton');
setTimeout((_) => myForm.value.showComponent('submitButton'), 1000);
});
</script>
|
|
showComponent
# |
name
|
None
|
Shows a hidden form element component from the list specified in the template .
<template>
<JqxForm ref="myForm" style="width: 450px; height: auto" :template="template" :value="value" />
</template>
<script setup>
import { onMounted, ref } from 'vue';
import JqxForm from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxform.vue';
const myForm = ref(null);
const template = ref([
{
bind: 'textBoxValue',
type: 'text',
label: 'Text input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
},
{
bind: 'passwordBoxValue',
type: 'password',
label: 'Password input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
},
{
bind: 'numberBoxValue',
type: 'number',
label: 'Number input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
},
{
name: 'submitButton',
type: 'button',
text: 'Submit Form Data',
align: 'right',
padding: { left: 0, top: 5, bottom: 5, right: 40 }
}
]);
const value = ref({
textBoxValue: 'text box value',
passwordBoxValue: 'password box',
numberBoxValue: 67.44
});
function onButtonClick(event) {
alert('Button Clicked...');
}
onMounted(() => {
myForm.value.hideComponent('submitButton');
setTimeout((_) => myForm.value.showComponent('submitButton'), 1000);
});
</script>
|
|
val
# |
value
|
Object
|
Sets or gets the value of the object to bind to the form.
<template>
<JqxForm ref="myForm" style="width: 450px; height: auto" :template="template" :value="value" />
</template>
<script setup>
import { onMounted, ref } from 'vue';
import JqxForm from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxform.vue';
const myForm = ref(null);
const template = ref([
{
bind: 'textBoxValue',
type: 'text',
label: 'Text input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
},
{
bind: 'passwordBoxValue',
type: 'password',
label: 'Password input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
},
{
bind: 'numberBoxValue',
type: 'number',
label: 'Number input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
},
{
name: 'submitButton',
type: 'button',
text: 'Submit Form Data',
align: 'right',
padding: { left: 0, top: 5, bottom: 5, right: 40 }
}
]);
const value = ref({
textBoxValue: 'text box value',
passwordBoxValue: 'password box',
numberBoxValue: 67.44
});
function onButtonClick(event) {
alert('Button Clicked...');
}
onMounted(() => {
const value = myForm.value.getInstance().val();
});
</script>
|
|
submit
# |
action, target, method
|
Void
|
Submits the form.
<template>
<JqxForm ref="myForm" style="width: 450px; height: auto" :template="template" :value="value" />
</template>
<script setup>
import { ref } from 'vue';
import JqxForm from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxform.vue';
const template = ref([
{
bind: 'textBoxValue',
type: 'text',
label: 'Text input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
},
{
bind: 'passwordBoxValue',
type: 'password',
label: 'Password input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
},
{
bind: 'numberBoxValue',
type: 'number',
label: 'Number input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
},
{
name: 'submitButton',
type: 'button',
text: 'Submit Form Data',
align: 'right',
padding: { left: 0, top: 5, bottom: 5, right: 40 }
}
]);
const value = ref({
textBoxValue: 'text box value',
passwordBoxValue: 'password box',
numberBoxValue: 67.44
});
function onButtonClick(event) {
// this.$refs.myForm.submit('URL', 'Target', 'Method');
// this.$refs.myForm.submit('https://www.jqwidgets.com/form_demo/', '_blank', 'Post');
}
</script>
|
|
getComponentByName
# |
name
|
Object
|
Gets a form input element by name.
<template>
<JqxForm ref="myForm" style="width: 450px; height: auto" :template="template" :value="value" />
</template>
<script setup>
import { onMounted, ref } from 'vue';
import JqxForm from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxform.vue';
const myForm = ref(null);
const template = ref([
{
bind: 'textBoxValue',
type: 'text',
label: 'Text input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
},
{
bind: 'passwordBoxValue',
type: 'password',
label: 'Password input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
},
{
bind: 'numberBoxValue',
type: 'number',
label: 'Number input',
labelPosition: 'left',
labelWidth: '30%',
align: 'left',
width: '250px',
required: true
},
{
name: 'submitButton',
type: 'button',
text: 'Submit Form Data',
align: 'right',
padding: { left: 0, top: 5, bottom: 5, right: 40 }
}
]);
const value = ref({
textBoxValue: 'text box value',
passwordBoxValue: 'password box',
numberBoxValue: 67.44
});
function onButtonClick(event) {
alert('Button Clicked...');
}
onMounted(() => {
const value = myForm.value.getComponentByName('submitButton');
});
</script>
|