Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How one input goes into 2 fields as the same value?

Featured Replies

I want to edit marks of a student. on edit page teacher should edit only mark-1 and so the mark-2 should be the same with mark-1 ( without using script)The teacher is allowed to change only mark-1. He will not see the mark-2. when he presses on submit button mark-2 will be editted with the same value as mark-1.

I used

<input type hidden mark-2=mark-1> but mark-2 takes the previous value of the mark-1

Abkaplan

Could you use callculation field?

And why 2 fields with the same value?

  • Author

Yes at first it looks like that it can be done with calculations. but the mark-2 will be editted later buy using local scripts or will be editted individually ( for some reasons ). so it is not possible to use calculation.

I can not put on the record detail page both mark-1 and mark-2 because users may input different values ( I can not rely on them ).

The only thing I need one input field should go into two different fields as the same value. Or I will change it to calculation by using another field and comparision in my calculation according to another control field but that will make the program over load ( yes that will be small action but think about hundreds of calculation. I have to be away from calculation as much as possible ).And also am I right in thinking like that ?

Abkaplan

It can be done with calcullation, but it will have to take into formula the edit date/time.

From Web maybe the JavaScript can help.

Use a redirect page in between the form page and the results page.

So the person submits the form, it goes to a second page that has a redirect url that edits the record just created and adds in the url

mark-1=[fmp-field: mark-1]&mark-2=[fmp-field: mark-1]&-recid=[fmp-currentrecid]&-edit

Make the format file the results page that you have now and voila, you have both fields filled with the same data

Simon

ok.. just use a little javascript.. it will work wonders..

in the head of the document put this code..

code:


<script>

<!--

function sync()

{

document.FORMNAME["mark-2"].value = document.FORMNAME["mark-1"].value

}

//--->

</script>


then put an onSubmit event handler in your form tag

<form name="FORMNAME" action="FMPRO" onSubmit="sync()">

you could also use and onChange or OnKeyUp event handler on the mark-1 text box, instead of the onSubmit in the form tag.. see which you like better

on Chage would look like this

<input name="mark-1" type="text" onChange="sync()">

and onKeyUp would look like this

<input name="mark-1" type="text" onKeyUp="sync()">

this should work.. if it doesnt let me know i may have made the call to the form fields wrong.. i forget exactly how to do it when the tag name has non-standard charaters in it (such as a hyphen "-"). but it should work.. let me know..

also make sure to change FORMNAME to the name of your form

[ April 10, 2001: Message edited by: bman ]

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.