diff -urNp sworig/source/ui/fldui/inpdlg.cxx sw/source/ui/fldui/inpdlg.cxx
--- sworig/source/ui/fldui/inpdlg.cxx	2005-09-09 15:44:10.000000000 +0800
+++ sw/source/ui/fldui/inpdlg.cxx	2006-08-25 20:23:06.000000000 +0800
@@ -95,6 +95,7 @@ SwFldInputDlg::SwFldInputDlg( Window *pP
 	aOKBT		(this, SW_RES(BT_OK		)),
 	aCancelBT	(this, SW_RES(BT_CANCEL	)),
 	aNextBT		(this, SW_RES(PB_NEXT	)),
+	aPreviousBT		(this, SW_RES(PB_PREVIOUS	)),
 	aHelpBT     (this, SW_RES(PB_HELP    )),
 	pInpFld(0),
 	pSetFld(0),
@@ -104,20 +105,31 @@ SwFldInputDlg::SwFldInputDlg( Window *pP
 	Font aFont(aEditED.GetFont());
 	aFont.SetWeight(WEIGHT_LIGHT);
 	aEditED.SetFont(aFont);
-
-	if( bNextButton )
-	{
-		aNextBT.Show();
-		aNextBT.SetClickHdl(LINK(this, SwFldInputDlg, NextHdl));
-	}
-	else
-	{
-		long nDiff = aCancelBT.GetPosPixel().Y() - aOKBT.GetPosPixel().Y();
-		Point aPos = aHelpBT.GetPosPixel();
-		aPos.Y() -= nDiff;
-		aHelpBT.SetPosPixel(aPos);
-	}
-
+	
+    SwField* pCurrField = rSh.GetCurFld();
+    
+    //if edit input field 
+    if (pCurrField)
+    {
+        //set the modify link to make field update as user type
+	    Link aModifyLk = LINK(this, SwFldInputDlg, ModifyHdl);
+	    aEditED.SetModifyHdl(aModifyLk);
+	    //set the cancel button link
+	    Link aCancelLk = LINK(this, SwFldInputDlg, CancelHdl);
+	    aCancelBT.SetClickHdl(aCancelLk);
+	
+	    aNextBT.SetClickHdl(LINK(this, SwFldInputDlg, NextHdl));
+	    aPreviousBT.SetClickHdl(LINK(this, SwFldInputDlg, PrevHdl));
+    }
+    else //newly create field
+    {
+        aNextBT.Hide();
+        aPreviousBT.Hide();
+        //enlarge aEditED to make the dialog looks clean after hide two buttons 
+		Size aSize = aEditED.GetSizePixel();
+		aSize.Height() += aNextBT.GetSizePixel().Height();
+		aEditED.SetSizePixel(aSize);
+    }
 	// Auswertung hier
 	String aStr;
 	if( RES_INPUTFLD == pField->GetTyp()->Which() )
@@ -163,8 +175,25 @@ SwFldInputDlg::SwFldInputDlg( Window *pP
 	aEditED.SetReadOnly( !bEnable );
 
 	if( aStr.Len() )
+	{
 		aEditED.SetText( aStr.ConvertLineEnd() );
+		Selection aNewSelection( 0, aStr.Len() );
+		aEditED.SetSelection( aNewSelection );
+	}
 	aEditED.GrabFocus();
+	aOriStr = aStr;
+	
+	//move the dialog to just above the input field
+	if (pCurrField)
+	{   
+        Point realPos = rSh.GetWin()->LogicToPixel( rSh.GetCrsrDocPos() );
+        long offY = rSh.GetWin()->GetOutOffYPixel();
+        long nWinPosY = realPos.Y() + offY - GetSizePixel().getHeight();
+        if (nWinPosY < 0)
+            nWinPosY = realPos.Y() + offY + GetSizePixel().getHeight()/2 - 14;
+        SetPosPixel( Point(realPos.X(), nWinPosY));
+    }
+    	
 	FreeResource();
 }
 
@@ -214,11 +243,157 @@ void SwFldInputDlg::Apply()
 	rSh.EndAllAction();
 }
 
-
 IMPL_LINK(SwFldInputDlg, NextHdl, PushButton*, EMPTYARG)
 {
-	EndDialog(RET_OK);
+	//EndDialog(RET_OK);
+	//return 0;
+	Apply();
+	
+	String aStr;
+	SwFieldType* pFld = rSh.GetFldType( 0, RES_INPUTFLD );
+	if( pFld && rSh.MoveFldType( pFld, TRUE ))
+	{
+		rSh.ClearMark();
+		SwField* pField = rSh.GetCurFld();
+		if( pField && RES_INPUTFLD == pField->GetTyp()->Which() )
+    	{	// Es ist eine Eingabefeld
+    		//
+    		pInpFld = (SwInputField*)pField;
+    		aLabelED.SetText( pInpFld->GetPar2() );
+    		USHORT nSubType = pInpFld->GetSubType();
+    
+    		switch(nSubType & 0xff)
+    		{
+    			case INP_TXT:
+    				aStr = pInpFld->GetPar1();
+    				break;
+    
+    			case INP_USR:
+    				// Benutzerfeld
+    				if( 0 != ( pUsrType = (SwUserFieldType*)rSh.GetFldType(
+    							RES_USERFLD, pInpFld->GetPar1() ) ) )
+    					aStr = pUsrType->GetContent();
+    				break;
+    		}
+    		
+    		//move the dialog to just below the input field
+    		Point realPos = rSh.GetWin()->LogicToPixel( rSh.GetCrsrDocPos() );
+            long offY = rSh.GetWin()->GetOutOffYPixel();
+            long nWinPosY = realPos.Y() + offY - GetSizePixel().getHeight();
+            if (nWinPosY < 0)
+                nWinPosY = realPos.Y() + offY + GetSizePixel().getHeight()/2 - 14;
+            SetPosPixel( Point(realPos.X(), nWinPosY));
+    	}
+    	
+    	
+    	aEditED.SetText( aStr.ConvertLineEnd() );
+    	aOriStr = aStr;
+    	
+    	if( aStr.Len() )
+	    {
+		    Selection aNewSelection( 0, aStr.Len() );
+		    aEditED.SetSelection( aNewSelection );
+	    }
+	}
+	else
+	{
+	    rSh.ClearMark();
+		SwField* pField = rSh.GetCurFld();
+		if( pField && RES_INPUTFLD == pField->GetTyp()->Which() )
+    		pInpFld = (SwInputField*)pField;
+	}
+	aEditED.GrabFocus();
+	
+	return 0;
+}
+
+
+IMPL_LINK(SwFldInputDlg, PrevHdl, PushButton*, EMPTYARG)
+{
+	Apply();
+	
+	String aStr;
+	SwFieldType* pFld = rSh.GetFldType( 0, RES_INPUTFLD );
+	if( pFld && rSh.MoveFldType( pFld, FALSE ))
+	{
+		rSh.ClearMark();
+		SwField* pField = rSh.GetCurFld();
+		if( pField && RES_INPUTFLD == pField->GetTyp()->Which() )
+    	{	
+    		//
+    		pInpFld = (SwInputField*)pField;
+    		aLabelED.SetText( pInpFld->GetPar2() );
+    		USHORT nSubType = pInpFld->GetSubType();
+    
+    		switch(nSubType & 0xff)
+    		{
+    			case INP_TXT:
+    				aStr = pInpFld->GetPar1();
+    				break;
+    
+    			case INP_USR:
+    				// Benutzerfeld
+    				if( 0 != ( pUsrType = (SwUserFieldType*)rSh.GetFldType(
+    							RES_USERFLD, pInpFld->GetPar1() ) ) )
+    					aStr = pUsrType->GetContent();
+    				break;
+    		}
+    		
+    		//move the dialog to just below the input field
+    		Point realPos = rSh.GetWin()->LogicToPixel( rSh.GetCrsrDocPos() );
+            long offY = rSh.GetWin()->GetOutOffYPixel();
+            long nWinPosY = realPos.Y() + offY - GetSizePixel().getHeight();
+            if (nWinPosY < 0)
+                nWinPosY = realPos.Y() + offY + GetSizePixel().getHeight()/2 - 14;
+            SetPosPixel( Point(realPos.X(), nWinPosY));
+    	}
+    	 	
+    	aEditED.SetText( aStr.ConvertLineEnd() );
+    	aOriStr = aStr;
+    	
+    	if( aStr.Len() )
+	    {
+		    Selection aNewSelection( 0, aStr.Len() );
+		    aEditED.SetSelection( aNewSelection );
+	    }
+	}
+	else
+	{
+	    rSh.ClearMark();
+		SwField* pField = rSh.GetCurFld();
+		if( pField && RES_INPUTFLD == pField->GetTyp()->Which() )
+    		pInpFld = (SwInputField*)pField;
+	}
+	aEditED.GrabFocus();
+	
 	return 0;
 }
 
+IMPL_LINK(SwFldInputDlg, ModifyHdl, void*, EMPTYARG)
+{
+	Apply();
+	
+	rSh.ClearMark();
+	SwField* pField = rSh.GetCurFld();
+	if( pField && RES_INPUTFLD == pField->GetTyp()->Which() )
+    	pInpFld = (SwInputField*)pField;
+    		
+	return 0;
+}
 
+IMPL_LINK(SwFldInputDlg, CancelHdl, void*, EMPTYARG)
+{
+	aEditED.SetText( aOriStr );
+	
+	Apply();
+	
+	if ( IsInExecute() )
+        EndDialog( FALSE );
+    else
+    {
+        if ( GetStyle() & WB_CLOSEABLE )
+            Close();
+    }
+    		
+	return 0;
+}
\ No newline at end of file
diff -urNp sworig/source/ui/fldui/inpdlg.hrc sw/source/ui/fldui/inpdlg.hrc
--- sworig/source/ui/fldui/inpdlg.hrc	2005-09-09 15:44:26.000000000 +0800
+++ sw/source/ui/fldui/inpdlg.hrc	2006-07-17 12:10:38.000000000 +0800
@@ -40,3 +40,4 @@
 #define ED_LABEL			7
 #define PB_NEXT				8
 #define PB_HELP				9
+#define PB_PREVIOUS			10
diff -urNp sworig/source/ui/fldui/inpdlg.src sw/source/ui/fldui/inpdlg.src
--- sworig/source/ui/fldui/inpdlg.src	2005-09-09 15:44:44.000000000 +0800
+++ sw/source/ui/fldui/inpdlg.src	2006-08-23 20:46:48.000000000 +0800
@@ -42,7 +42,7 @@ ModalDialog DLG_FLD_INPUT
 	OutputSize = TRUE ;
 	Hide = TRUE ;
 	SVLook = TRUE ;
-	Size = MAP_APPFONT ( 194 , 119 ) ;
+	Size = MAP_APPFONT ( 194 , 77 ) ;
 	Text [ de ] = "Eingabefeld" ;
 	Text [ en-US ] = "Input Field" ;
 	Moveable = TRUE ;
@@ -57,9 +57,9 @@ ModalDialog DLG_FLD_INPUT
 	Edit ED_LABEL
 	{
 		Border = TRUE ;
-		Pos = MAP_APPFONT ( 12 , 14 ) ;
+		Pos = MAP_APPFONT ( 12 , 12 ) ;
 		Size = MAP_APPFONT ( 115 , 12 ) ;
-		TabStop = TRUE ;
+		TabStop = FALSE ;
 		Left = TRUE ;
 		Text [ de ] = "Eingabe" ;
 		Text [ en-US ] = "Input" ;
@@ -69,8 +69,8 @@ ModalDialog DLG_FLD_INPUT
 	MultiLineEdit ED_EDIT
 	{
 		Border = TRUE ;
-		Pos = MAP_APPFONT ( 12 , 32 ) ;
-		Size = MAP_APPFONT ( 115 , 72 ) ;
+		Pos = MAP_APPFONT ( 12 , 28 ) ;
+		Size = MAP_APPFONT ( 115 , 24 ) ;
 		TabStop = TRUE ;
 		Left = TRUE ;
 	};
@@ -82,32 +82,42 @@ ModalDialog DLG_FLD_INPUT
 		Text [ en-US ] = "Edit" ;
 		Text [ x-comment ] = " ";
 	};
-	OKButton BT_OK
+	PushButton PB_PREVIOUS
 	{
-		Pos = MAP_APPFONT ( 139 , 6 ) ;
+		Pos = MAP_APPFONT ( 12 , 58 ) ;
 		Size = MAP_APPFONT ( 50 , 15 ) ;
 		TabStop = TRUE ;
-		DefButton = TRUE ;
+		Text [ en-US ] = "<< ~Previous" ;
+		Text [ x-comment ] = " ";
 	};
-	CancelButton BT_CANCEL
+	PushButton PB_NEXT
 	{
-		Pos = MAP_APPFONT ( 139 , 23 ) ;
+		Pos = MAP_APPFONT ( 78 , 58 ) ;
 		Size = MAP_APPFONT ( 50 , 15 ) ;
 		TabStop = TRUE ;
+		Text [ de ] = "~Weiter >>" ;
+		Text [ en-US ] = "~Next >>" ;
+		Text [ x-comment ] = " ";
+		DefButton = TRUE ;
 	};
-	PushButton PB_NEXT
+	OKButton BT_OK
 	{
-		Pos = MAP_APPFONT ( 139 , 40 ) ;
+		Pos = MAP_APPFONT ( 139 , 6 ) ;
 		Size = MAP_APPFONT ( 50 , 15 ) ;
 		TabStop = TRUE ;
-		Hide = TRUE ;
-		Text [ de ] = "~Weiter" ;
-		Text [ en-US ] = "~Next" ;
-		Text [ x-comment ] = " ";
+		Text [ en-US ] = "~OK" ;
+		//DefButton = TRUE ;
 	};
+	CancelButton BT_CANCEL
+	{
+		Pos = MAP_APPFONT ( 139 , 23 ) ;
+		Size = MAP_APPFONT ( 50 , 15 ) ;
+		TabStop = TRUE ;
+		Text [ en-US ] = "~Cancel" ;
+	};	
 	HelpButton PB_HELP
 	{
-		Pos = MAP_APPFONT ( 139 , 60 ) ;
+		Pos = MAP_APPFONT ( 139 , 40 ) ;
 		Size = MAP_APPFONT ( 50 , 15 ) ;
 		TabStop = TRUE ;
 	};
diff -urNp sworig/source/ui/inc/inpdlg.hxx sw/source/ui/inc/inpdlg.hxx
--- sworig/source/ui/inc/inpdlg.hxx	2005-09-09 17:21:04.000000000 +0800
+++ sw/source/ui/inc/inpdlg.hxx	2006-08-15 10:13:44.000000000 +0800
@@ -76,12 +76,17 @@ class SwFldInputDlg: public SvxStandardD
 	OKButton  			aOKBT;
 	CancelButton 		aCancelBT;
 	PushButton			aNextBT;
+	PushButton			aPreviousBT;
 	HelpButton			aHelpBT;
+	String              aOriStr;
 
 	DECL_LINK(NextHdl, PushButton*);
+	DECL_LINK(PrevHdl, PushButton*);
+	DECL_LINK(ModifyHdl, void*);
+	DECL_LINK(CancelHdl, void*);
 public:
 	SwFldInputDlg( 	Window *pParent, SwWrtShell &rSh,
-					SwField* pField, BOOL bNextButton = FALSE );
+					SwField* pField, BOOL bNextButton = TRUE );
 	~SwFldInputDlg();
 };
 
