button type in the input field

A place for users and developers of the Xataface to discuss and receive support.

button type in the input field

Postby kevinwen » Wed Jun 23, 2010 12:16 am

Hi, Steve

How do I create a button within a form in the fields.ini, so the following html code shows in the edit form?
Code: Select all
<input type="button" value="Click me" onclick="msg()" />
kevinwen
 
Posts: 109
Joined: Mon Dec 28, 2009 3:44 pm

Re: button type in the input field

Postby shannah » Wed Jun 23, 2010 9:21 am

You would need to use a block or slot and place the button somewhere in the form.

-Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: button type in the input field

Postby kevinwen » Wed Jun 23, 2010 1:23 pm

I know I can use one of blocks(block__findform_after_person_id_row, block__findform_xxx_widget, findform_after__widget, etc.) available to output the html code for the button , but I couldn't find a ideal block for that because layout looks ugly. Currently I have a block defined in fields.ini looks like this in html code:

Code: Select all
<tr id="person_id_findform_row">
      <td align="right" valign="top" class="Dataface_QuickForm-label-cell Dataface_FindForm-label-cell">
      <div id="findform_people-person_id-label-wrapper" class="field">
         <label>Locator#</label>
      </div>
      </td>
      <td class="Dataface_QuickForm-widget-cell Dataface_FindForm-widget-cell">
      <div id="people-person_id-wrapper" class="field">
         <div>
            <input type="text" value="2728" name="-findq:person_id" id="person_id" class="default">
         </div>
         <div class="formHelp"></div>
      </div>
      </td>
</tr>


What I want to do is add a button as a separate row or the 2nd table cell next to the 'Find' button' in the form, just like the following:
Code: Select all
<tr id="clearform_findform_row">
      <td align="right" valign="top" class="Dataface_QuickForm-label-cell Dataface_FindForm-label-cell">
      <div id="findform_people-clearform-label-wrapper" class="field">
         <label>Clear all</label>
      </div>
      </td>
      <td class="Dataface_QuickForm-widget-cell Dataface_FindForm-widget-cell">
      <div id="people-clearform-wrapper" class="field">
         <div>
            <input type="button" value="Clear Form" name="-findq:clearform" id="clearform" class="default" onclick="resetForm(this.form);">
         </div>
         <div class="formHelp"></div>
      </div>
      </td>
</tr>


How can I do that?
kevinwen
 
Posts: 109
Joined: Mon Dec 28, 2009 3:44 pm

Re: button type in the input field

Postby shannah » Thu Jun 24, 2010 8:53 am

There should be an appropriate slot to place it right beside the submit button.... I don't have the info handy, but if you turn on debug it will list them all out.

Alternatively you can always use javascript to modify any part of the page and add a button wherever you want it.
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: button type in the input field

Postby kevinwen » Thu Jun 24, 2010 11:37 am

I found there is a block findform_after__widget around the submit button. However, this block appears after all of the "Do not match selected" radio buttons for multiple-select. Is it possible to check if this findform_after__widget block after a certain element so I decide whether or not to output the html code for the button?
kevinwen
 
Posts: 109
Joined: Mon Dec 28, 2009 3:44 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 29 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved