General discussion

Locked

invisible submit button onload of form

By Shanghai Sam ·
HEllo All

I have perpared 1 asp documents which has 2 forms

1 st form is frequently populated on submit for asking data to user.

2 nd form is called on if conditon (this form will be called when two variables of form 1 will reduce to zero.
now i want: ON the load of 2nd form the submit button of 1st form to be invisible.
<html>
<form name=f5 >

<center><input type=submit name="button1" value="Next page" onclick= "gotonextpage()"></center>


</form>
</body>
</html>
<% if totalcat_prod =0 and nooftable = "" then %>
<html>
<head>
<script>
function unablebutton()
{
(document.f5.button1.style="VISIBILITY: hidden");
}
</script>
</head>
<body onload = "unablebutton()">
<form name = f2>
hello
</form>
</body>
</html>
Thanks
Arati

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

invisible submit button onload of form

by johnfriz In reply to invisible submit button o ...

I am a bit confused with the code that you have provided.

You seem to have 2 <html> </html> tags on the one page??

What I would sugest is that you do the if statement before adding the button.

Only if the varaibles form form 1 are 0 will the button be displayed. Otherwise, the report is displayed.

Based on what you have given, I have done my best to change your code to explain what I mean...

<html><body><form>

I assume that the user input code is here??????????????

<% if totalcat_prod =0 and nooftable = "" then %>
</form> (End the first form)

<form name = f2> (start the new form)
Load report for user
</form> (end the new form)
</body>
</html>
<%else%>
<center><input type=button name="button1" value="Next page" onclick= "gotonextpage()"></center>
</form></body></html>
<%end if%>

Hope this helps. If have misunderstood, let me know.

regards,
John.

Collapse -

invisible submit button onload of form

by parkin_thom In reply to invisible submit button o ...

I think John did not completely understand your question.
I can see that you displayed BOTH pages together. And, it appears you are on the right track.
I would suggest that instead of using onLoad of the body you should use onBlur(). This event is fired when the page is no longer the focus. So, when your other form pops-up, the button visibility would be turned off.

THOM
twice21.com

Back to Web Development Forum
2 total posts (Page 1 of 1)  

Related Forums