Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
YogeshM #1
Adding items to a cfgrid
Hi! I'm trying to add items to a cfgrid using form elements. E.g. I have fname
textfield, lname textfield, market comboBox, etc in my form I want to have a
button called 'Add New' (I know the cfgrid has an attribute called insert, but
i don't want this one) which adds the values that I have input in the form
fields mentioned above, into the data grid in the appropriate columns. Can
somebody pls help me with this? Thanks and regards, Yogesh Mahadnac My form
code is as follows:
<cfform format="flash" action="process_info.cfm" method="post">
<cfformgroup type="horizontal">
<cfformgroup type="hdividedbox">
<cfinput type="text" name="fname" label="First Name"
width="100">
<cfinput type="text" name="lname" label="Last Name" width="100">
<cfinput type="text" name="email" label="Email" width="100">
<cfinput type="text" name="userName" label="Username"
width="100">
<cfinput type="password" name="userPass" label="Password"
width="100">
</cfformgroup>
<cfformgroup type="hdividedbox">
<cfselect name="userMarket" query="allMarkets"
display="mkt_name" value="id_market" queryPosition="below" label="Select
Market">
<option value = "">Select One</option>
</cfselect>
<cfinput type="button" name="btnAdd" value="Add New"
onclick="when i click this button i want to add the form values to the grid
below">
</cfformgroup>
</cfformgroup>
<cfformgroup type="horizontal">
<cfgrid name="userGrid" selectmode="edit">
<cfgridcolumn name="fname" header="First Name"
dataalign="center" width="200">
<cfgridcolumn name="lname" header="Last Name"
dataalign="center" width="200">
<cfgridcolumn name="email" header="Email" dataalign="center"
width="200">
<cfgridcolumn name="username" header="User Name"
dataalign="center" width="100">
<cfgridcolumn name="pass" header="Password" display="no"
dataalign="center" width="100">
<cfgridcolumn name="id_market" header="Market ID" display="no"
dataalign="center" width="100">
<cfgridcolumn name="mkt_name" header="Market Name"
dataalign="center" width="100">
</cfgrid>
</cfformgroup>
</cfform>
YogeshM Guest
-
Adding previous and next links in the cfgrid
I have been reading through a few of these topics, and have not found an answer to this question. Is there built in functionality within MX7 that... -
Add Items to CFGrid
The scenario is simple. I have a textbox where the user enters some value, clicks an "Add" button and I want that value to get added to a CFGrid... -
adding list items to a database
Not sure if this is javascript or php so i put it in both newsgroups, sorry if it's the wrong group. I wrote (with help) a code to put several... -
adding items to a list or menu
Not sure if it is a php question but since i am working in php here it is. Ho can i add items to (the item label=visual text and the value=index... -
Adding Attributes to RadioButtonList Items?
I am trying to use a RadioButtonList bound to a custom datasource to acomplish some user functionality. I want to add various... -
LeftCorner #2
Re: Adding items to a cfgrid
Add the attribute
insertbutton='Insert button text' to your cfgrid tag.
<cfgrid name='userGrid' selectmode='edit' insertbutton='Add New' >
LeftCorner Guest
-
YogeshM #3
Re: Adding items to a cfgrid
Hi! Thanks for replying so soon. Actually , I KNOW there's the inserbutton
attribute in the cfgrid tag. But I DON'T WANT this insert. I want to add new
items to the grid from the form elements I created (fname, lname, email,
userName, etc) to their corresponding fields in the cfgrid. In fact, I DON'T
WANT TO WORK WITH THE INSERT ATTRIBUTE OF THE CFGRID. I want to be able to add
items to the datagrid from any other form elements I create. Thanks and
regards, Yogesh Mahadnac.
YogeshM Guest
-
Mike Nimer #4
Re: Adding items to a cfgrid
This will do it.
<cfinput type="button" name="ins" value="Insert Row"
onClick="myGrid.insertRow(myGrid);">
---nimer
"YogeshM" <webforumsuser@macromedia.com> wrote in message
news:d1m8kb$j2k$1@forums.macromedia.com...> Hi! Thanks for replying so soon. Actually , I KNOW there's the inserbutton
> attribute in the cfgrid tag. But I DON'T WANT this insert. I want to add
> new
> items to the grid from the form elements I created (fname, lname, email,
> userName, etc) to their corresponding fields in the cfgrid. In fact, I
> DON'T
> WANT TO WORK WITH THE INSERT ATTRIBUTE OF THE CFGRID. I want to be able to
> add
> items to the datagrid from any other form elements I create. Thanks and
> regards, Yogesh Mahadnac.
>
Mike Nimer Guest
-
Mike Nimer #5
Re: Adding items to a cfgrid
sorry, scratch that last post. This is the right code
<cfinput type="button" name="ins" value="Insert Row"
onClick="GridData.insertRow(myGrid);">
----nimer
"Mike Nimer" <mnimer@macromedia.com> wrote in message
news:d1n7nv$97o$2@forums.macromedia.com...> This will do it.
>
> <cfinput type="button" name="ins" value="Insert Row"
> onClick="myGrid.insertRow(myGrid);">
>
> ---nimer
>
> "YogeshM" <webforumsuser@macromedia.com> wrote in message
> news:d1m8kb$j2k$1@forums.macromedia.com...>>> Hi! Thanks for replying so soon. Actually , I KNOW there's the
>> inserbutton
>> attribute in the cfgrid tag. But I DON'T WANT this insert. I want to add
>> new
>> items to the grid from the form elements I created (fname, lname, email,
>> userName, etc) to their corresponding fields in the cfgrid. In fact, I
>> DON'T
>> WANT TO WORK WITH THE INSERT ATTRIBUTE OF THE CFGRID. I want to be able
>> to add
>> items to the datagrid from any other form elements I create. Thanks and
>> regards, Yogesh Mahadnac.
>>
>
Mike Nimer Guest



Reply With Quote

