Calculation...

1

116

I have been using this piece of script in forms, and just tweaking it when
needed. I have created an edit.asp page. This being database results, not
quite sure how to tweak.

<script type="text/javascript">
function calcinc()
{
with (document.FrontPage_Form1)
{ DashNumber.value = +DashNumber.value + +"1";
if (DashNumber.value < 10)
DashNumber.value = '0' + DashNumber.value;
else if (DashNumber.value >= 10)
DashNumber.value = '' + DashNumber.value;
}
/* Note the extra + operators. */
}
</script>

Any assist would be appreciaited.

David
 
S

Stefan B Rusynko

Explain how you are using the Client side script you posted
- which adds 1 to all values of form fields named DashNumber, then adds a leading 0 if the value is less then 10

ASP uses server side script to process form fields
- but you can still use the same client side script to update user entries before you send the form

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________


I have been using this piece of script in forms, and just tweaking it when
needed. I have created an edit.asp page. This being database results, not
quite sure how to tweak.

<script type="text/javascript">
function calcinc()
{
with (document.FrontPage_Form1)
{ DashNumber.value = +DashNumber.value + +"1";
if (DashNumber.value < 10)
DashNumber.value = '0' + DashNumber.value;
else if (DashNumber.value >= 10)
DashNumber.value = '' + DashNumber.value;
}
/* Note the extra + operators. */
}
</script>

Any assist would be appreciaited.

David
 
S

Stefan B Rusynko

Post a URL to the page using it

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________


There is a button on the form 'Increment' that is for the user.
 
1

116

Stefan...thanks for the assist. I found that the issue was that my form name
was not being retained after saving the page. Reason unknown. I changed the
script to document.forms[#]. works fine now.

David

Stefan B Rusynko said:
Post a URL to the page using it

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________


There is a button on the form 'Increment' that is for the user.

Stefan B Rusynko said:
Explain how you are using the Client side script you posted
- which adds 1 to all values of form fields named DashNumber, then adds a leading 0 if the value is less then 10

ASP uses server side script to process form fields
- but you can still use the same client side script to update user entries before you send the form

--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________


I have been using this piece of script in forms, and just tweaking it when
needed. I have created an edit.asp page. This being database results, not
quite sure how to tweak.

<script type="text/javascript">
function calcinc()
{
with (document.FrontPage_Form1)
{ DashNumber.value = +DashNumber.value + +"1";
if (DashNumber.value < 10)
DashNumber.value = '0' + DashNumber.value;
else if (DashNumber.value >= 10)
DashNumber.value = '' + DashNumber.value;
}
/* Note the extra + operators. */
}
</script>

Any assist would be appreciaited.

David


.


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top