How to clear all fields on the page by using javascript ?

Hello,
has anyone an example of javascript function that clears all fields on the page?
Thanks

Hi Edward,
You may want to have a look here http://textsnippets.com/posts/show/215
Or try this (source from http://www.mindpalette.com/tutorials/clear_defaults/index.php):
function MPClearAll() {
with (document.forms[thisForm]) {
for (var n=0; n<defaultVals.length; n++) {
var thisField = defaultVals[n][0];
var thisDefault = defaultVals[n][1];
if (elements[thisField].value == thisDefault)
elements[thisField].value = '';
}}}Hope that helps,
Dimitri

Similar Messages

  • How to place aggregated fields in the page header or group header

    Hi,
    i have a report where in i have to display a header based on the aggregated value of a field
    currently the field has values like
    row1  blank
    row2  blank
    row3 Cookies
    row4 blank
    I wanted to know how to get the maximum of these rows in the page header i.e. it should come as Cookies for this case.
    Is there any way to get this? it is easy in the footer where i can do a maximum of this field and get the value but not sure how to get this in the group header.How do we group maximum at the page header or group header?
    Require your help on this at the earliest.
    Thanks
    Shilpi

    Hi Shilpi,
    >
    Shilpi Sinha wrote:
    > currently the field has values like
    > row1  blank
    > row2  blank
    > row3 Cookies
    > row4 blank
    >
    Do display these things in a subreport(i mean adda subreport in detail section). And Create a formula in the subreport itself with shared varible for assiging  the maximum value ..
    Then in the main report , create one formula with same shared variable and just display in Header secton..
    Regards,
    Salah.

  • How to clear all data when the form loading at the first time

    hi
    I am using JDevloper 10g and I have adfForm page, I want to clear all data when I load the page for the first time.
    When I did it using RefreshCondition on the pageDef in the executables like(
    <executables>
    <iterator id="FinCompaniesInformaton1ViewIterator" RangeSize="10"
    Binds="FinCompaniesInformaton1View"
    DataControl="AppModuleDataControl" *RefreshCondition="#{adfFacesContext.postback==true}"* />
    </executables>
    the form didn't bring any data but the problem is the field in the form at the run time changed to read only. So how to make it inputText and clear the data inside it at the run time
    best regards
    Tarek Al Soudani

    thank you for your help,my spec is I have ADF Form and I have creat and Edit CommandButton I made it befor also Commite to save.
    so when I run the form the Field should be disabled and there are no data inside it,and when I chose the creat button the fields should be enabled and I have to insert data inside it then I save.
    So I have FinCompaniesInformatonView as view object based on entity object name FinCompaniesInformaton and applicationMoudul.
    I tolde you befor that I made refreshcondition to solve the data clearence problem but the field changed to read only so please if you now any way to leave the fields as inputText whitout make the form as creation form
    beast regards

  • How to disable all fields of a page on button click

    Hello, I am using JDeveloper 11.1.2.3.0
    I have a page with several fields on it. I want to have all the page fields disabled when I click a certain Button. How can I achieve this?
    If what I am asking is too difficult to achieve can you help me with an idea on how to achieve something similar?
    Thank you

    This can be achieved by using JavaScript Client API get the id's all the fields while clicking the button  and disable your Components,
    Calling Backing bean method or binded component involves server side round-trip, you can easily achieve this using simple java script in
    Client Side..
    Call this method in your Client Listener ..
    function disableFields(actionEvent) {
            var field1= AdfPage.PAGE.findComponent("field1id");
            var field2 = AdfPage.PAGE.findComponent("field2id");
            field1.setDisabled(true);
            fileld2.setDisabled(true);

  • How to clear text fields when the user navigates back to the screen

    Hi,
    Does anyone have any idea on how to clear the text input fields and dropdown boxes when the user navigates back to the screen, say for e.g. create screen?
    My issue is that i have plenty of fields in the create screen within a form. Is there a way to avoid programaticaly blanking out every field and just do it at the form level using an api to reset to a state before the user entry?
    Thanks

    This code allows you to make it more generic, and you would need to tweak it if there are more than TextInput controls, but it should provide some ideas.
    As far as using states, you could use SetProperty to set the text to empty, but that might be messier.
    <?xml version="1.0"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
      <mx:Script>
        <![CDATA[
          import mx.containers.FormItem;
          import mx.controls.TextInput;
          import mx.events.IndexChangedEvent;
          import mx.core.Container;
          private function clearSreen(evt:IndexChangedEvent):void{
            var view:Container = tn.selectedChild as Container;
            for each(var child:Object in view.getChildren()){
              if(child is FormItem){
                var subchild:DisplayObject = child.getChildAt(0);
                if(subchild is TextInput){
                  TextInput(subchild).text = "";
        ]]>
      </mx:Script>
      <mx:TabNavigator id="tn" resizeToContent="true"
        change="clearSreen(event)">
        <mx:Form id="frm1" label="View Number One">
          <mx:FormItem label="First name:">
            <mx:TextInput/>
          </mx:FormItem>
          <mx:FormItem label="Last name:">
            <mx:TextInput/>
          </mx:FormItem>
        </mx:Form>
        <mx:Form id="frm2" label="View Number Two">
          <mx:FormItem label="Address1:">
            <mx:TextInput/>
          </mx:FormItem>
          <mx:FormItem label="Address2:">
            <mx:TextInput/>
          </mx:FormItem>
          <mx:FormItem label="City:">
            <mx:TextInput/>
          </mx:FormItem>
          <mx:FormItem label="State:">
            <mx:TextInput/>
          </mx:FormItem>
          <mx:FormItem label="Zip code:">
            <mx:TextInput/>
          </mx:FormItem>
        </mx:Form>
      </mx:TabNavigator>
    </mx:Application>
    If this post answers your question or helps, please mark it as such. Thanks!
    http://www.stardustsystems.com
    Adobe Flex Development and Support Services

  • Master Detail Form - How 2 update a field in the Detail form using a query?

    Hello,
    I have a master detail form with, each master record having a fixed(6) number of detail records. One of the fields in the detail record is the PART_DESCRIPTION field. I am trying to update this field by querying Table_X. TABLE_X is in the format of (desciption id, description). Description id runs from 1 to 6.
    When the form displays, the PART_DESCRIPTION field for the 6 detail records needs to be automatically populated with the six values of description stored in Table_X. How can this be done?
    Tried using session storage objects, but made no headway.
    Would greatly appreciate pointers on how to go about doing this.
    Thanks.
    Dev

    If you are on a Portal Version lesser than 3.0.9.8.3, then please try the following to populate
    the PART_DESCRIPTION field.
    Steps:-
    1> Edit the form and go to the Additional PL/SQl section and put the following code in the
    "...after displaying the page area" :-
    declare
    type t_vc_arr is table of varchar2(4000) index by binary_integer;
    l_arr_desc t_vc_arr;
    l_form_name varchar2(200);
    l_form_state varchar2(500);
    begin
    l_form_name := p_session.get_module().get_name();
    l_form_state := p_session.get_value_as_varchar2(
    p_block_name => 'MASTER_BLOCK',
    p_attribute_name => '_FORM_STATE'
    if l_form_state = 'QUERY_AND_SAVE' then
    select description
    bulk collect into l_arr_desc
    from <schema>.table_x;
    htp.p('
    <script>
    var descArr = new Array();
    var Fidx = 1;
    var formObj = document.WWVM'||p_session.get_id()||';
    var fieldName = "'||l_form_name||'.DETAIL_BLOCK.PART_DESCRIPTION.0";
    for i in 1..l_arr_desc.count loop
    htp.p('descArr['||to_char(i-1)||']="'||l_arr_desc(i)||'";');
    end loop;
    htp.p('
    for (var i=0; i < formObj.length; i++){
    if (formObj.elements.name == fieldName+Fidx){
    formObj.elements[i].value = descArr[Fidx-1];
    ++Fidx;
    htp.p('</script>');
    end if;
    end;

  • How to skip one field from the file by using sqlldr

    Hi ,
    i'm using DB 10g R2 on Redhat ,
    my control file hereunder ,
    LOAD DATA
    INTO TABLE reber.AAA_BILL
    APPEND
    REENABLE DISABLED_CONSTRAINTS
    EXCEPTIONS reber.AAA_BILL
    FIELDS TERMINATED BY '|'
    (Streamnumber ,
    MDN ,
    USERNAME ,
    DOMAIN ,
    USERIP ,
    CORRELATION_ID ,
    ACCOUNTREASON ,
    STARTTIME ,
    PRIORTIME ,
    CURTIME ,
    SESSIONTIME  ,
    SESSIONVOLUME ,
    RATEPOLICYIDX ,
    FEE ,
    GROUPID ,
    SERVICEID)and this is one records of the file ,
    222|1|0664363446|12D0DC90||10.15.6.45|007b8aa5|3|20111029204824|20111029204824|20111029211504|1600|0|147|0|4000|10154|really i want to skip the first field in the file which is (222|) and starting from the second field ,
    any help please

    Thank you for you reply ,
    really i know the Filler to skip colomn from the table , is the Filler working also to skip field from the File . i'll read the link to check this

  • Facebook is not loading properly and all my text and images are lined up along the right side of the page. How can this get fixed to the way it use to be?

    Facebook is not loading properly and all my text and images are lined up along the right side of the page. How can this get fixed to the way it use to look?
    Everyone who logs into Facebook on my Firefox has this problem however if we use Internet Explorer - facebook looks normal.

    If you have increased the minimum font size then try the default setting "none" as a high value can cause issues like you described.
    * Tools > Options > Content : Fonts & Colors > Advanced > Minimum Font Size (none)
    *Tools > Options > Content : Fonts & Colors > Advanced > [X] "Allow pages to choose their own fonts, instead of my selections above"

  • How do I clear all devices from the iPhone 5 Bluetooth

    I tries to repair my iPhone 5 to an 2009 Acura MDX but the keep retrieving.

    settings >>>>bluetooth...touch i in blue circle on each devive one at a time >>>forrget this device
    Also suggest you clear all pairings on the car bluetooth >>>refer to car manual

  • How to print all columns in one page

    Hi,
    Can anybody explain me how to print all columns in one page.we have around 15 to 20 columns for 4 reports and all these reports are build on one multiprovider.we are using BW 3.5.
    Can anyone explain me  how to print ALL COLUMNS IN ONE PAGE  .currently they are getting all columns in 2 to 3 pages. They are using PORTAL to run the reports here.
    Is it possible to do by customizing Webtemplate or by macros in Workbook.Please help me
    Edited by: kotha123 on Oct 11, 2010 5:58 PM

    Hi,
    Your best bet is to use a workbook template or else Excel to pdf option...Thanks

  • Me and my partner are currently using the same apple id and have no space left on our devices. We are currently waiting on the iphone 6 plus to arrive and don't know how to transfer all data to the new phones.

    Me and my partner are currently using the same apple id and have no space left on our devices. We are currently waiting on the iphone 6 plus to arrive and don't know how to transfer all data to the new phones.?

    I don't know if I'm asking this all in a way that can be understood? Thanks ED3K, however that part I do understand (in the link you provided!)
    What I need to know is "how" I can separate or rather create another Apple ID for my son-who is currently using "my Apple ID?" If there is a way to let him keep "all" his info on his phone (eg-contacts, music, app's, etc.) without doing a "reset?') Somehow I need to go into his phone's setting-create a new Apple ID and possibly a new password so he can still use our combined iCloud & Itunes account?
    Also then letting me take back my Apple ID & password, but again allowing us (my son and I) to use the same iCloud & Itunes account? Does that make more sense??? I'm sincerely trying to get this cleared up once and for all----just need guidance from someone who has a true understanding of the whole Apple iCloud/Itunes system!
    Thanks again for "anyone" that can help me!!!

  • How to clear all overrides in a story

    Hi Everyone!
    I've been putting together a short script to clear all overrides in a story in which I have a cursor inserted. This is what I have so far:
    //Clear all overrides in the story of the text selection:
    app.selection[0].paragraphs.everyItem().clearOverrides();
    //Clear overrides in all cells of all tables of the story of the text selection:
    try {
      app.selection[0].parentStory.tables.everyItem().cells.everyItem().texts[0].clearOverrides();
    catch (e) {}
    It works well enough, but I have to select all to clear the overrides on paragraph styles. If I don't select anything, only the style overrides in tables are cleared.
    How would I modify line 2 to work the same as line 6? I've tried a few different things, but no dice!
    I'm going to make this another question:
    Can anyone suggest a good recent book or online resource to start learning scripting for Indesign?
    I've been loving what we can do with scripts, but I want to start understanding what I'm doing, not just how to do it.
    Thanks a bunch!
    Amy

    Hi,
    In case of modifying a code:
    clearOverrides() is a method ==> it means some procedure will be executed (simple or pretty complex).
    the target for this method is placed before it ==> here it is every paragraph which can be reached basing on selection.
    So your goal is to change a target to parentStory, I guesss.
    Modified line should look like:
    app.selection[0].parentStory.clearOverrides();
    It will work till selection has a property parentStory. A graphic frame - which also can be selected - has not, so code will end with an error.
    How to detect available object's properties and methods?
    Exam this huge help files published by [Jongware] here:
    Indesign JavaScript Help
    many help PDFs can be googled. Just try. I recommend Peter Kahrel books (any you can google out - in fact )
    Jarek

  • How to clear all component in internalframe?

    I want to clear all components in the frame, but the frame isn't remove, just remove all components, it becouse i want to add anothers component. So i just want a new blank frame. how must i do?

    sayunara wrote:
    i has two frame 1 main frame,1 internalframe. if i use internalFrame.removeAll(), my internalFrame is gone too, i just want to remove components in the internalframe, but not the internalframe.Don't post in this thread, I have tried to direct all answers to the other thread (that's why I posted a link in this one)

  • How to clear all details in iCal before syncing with Entourage?

    Deary me! I have been back and forth to iCal and Entourage trying to find which would be best. I have decided that Entourage will suffice - although not perfect by any means. In the meantime I have completely jammed up my iCal and daren't not try syncing Entourage yet otherwise I will never understand it and my iphone will be full of toot! Anyone know how to clear all details in iCal before syncing with Entourage? (Happy Sundays!!)

    Answer .... delete all calendars in iCal but leave the Entourage one there! Don't delete that as there will be big trouble!

  • How to retrieve all fields from Entiy Bean

    Is there a simpler way to retrieve all fields from the entity bean than calling each individual get method?
    I need to retrieve the entire record not the contents of the entire table.
    Though, I may eventually need to do that also.
    I have 56 fields on this table. It does not make sense to code a get statement for every field.
    If you can direct me to sample code that would be good.
    Also, are there any good examples out there of how to create an entity bean or session bean using a local interface?
    Thanks,
    Jim

    I think you are confusing an EJB with a DAO.
    If you want to access the database why not just use JDBC?

Maybe you are looking for

  • JRE 1.4.2_04 install and un-install issues

    I was having problems running a Java app and I decided to un-install and re-install my JRE. I am running Windows XP Pro SP1 and IE6 SP1 as well. I went to "Add remove programs" and I noticed I had both of the following: Java 2 Runtime Environment, St

  • Mic Distortion

    I, like a lot of other people it seems, am getting mic distortion for some unknown reason. When recording, the mic starts perfectly, with no distortion, then after 3 seconds the distortion exacerbates more and more. Does anyone know what is with this

  • Factory reset problem lumia 925 HELP NEEDED!!!

    I factory reset my lumia 925 last night and the home screen will now only display 2 cogs turning and wont switch on, iv tried using the power and volume keys to reset but the problem persists, the handset was charging normally until i factory reset i

  • Eliminate duplicate rows from the report 6i output

    Hi All, I have generated a report output with the group by and summary options. For Ex: report has num and amount columns I had to sum the amount group by num NUM AMOUNT 1 100 1 50 2 10 2 100 After group by and summary functions the report is generat

  • Have used Firefox for 5 years or so, and Love it. I do get annoyed when an update makes me lose my Roboform toolbar, and it takes hours to get it back.

    An automatic Firefox update this morning made my Roboform toolbar disappear. I reinstalled the latest version of Roboform and checked the enable toolbar box, but it still doesn't show up. I can use Chrome, but I am so much more comfortable navigating