Jump to content

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


This topic is 8500 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 ]

Link to comment
Share on other sites

This topic is 8500 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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