Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to hide radio and command buttons in a page .

Posted on 2005-04-15
5
Medium Priority
?
213 Views
Last Modified: 2010-08-05
Hello,

I am new to programming and also to ASP.  I would appreciate if someone could help me on this.

I have two radio buttons and a command button which when clicked will run a procedure that sends out emails to customers. I also have a command button before these radio buttons that call stored procedures.  I need to hide or blur the radio buttons and send email command button when the stored procedures are running. When the procedure completes then the radio buttons and the send email button needs to be visible.

Thanks a lot!!
Lalitha
0
Comment
Question by:Lalitha_Ramalingam
  • 3
  • 2
5 Comments
 
LVL 29

Expert Comment

by:rdivilbiss
ID: 13791202
When you click the button to run your stored procedure, the page needs to be submitted to the server in order to run the ASP that runs the stored procedure.  At that time the page isn't being displayed and shouldn't be, until the sp has completed, which means no one can see or modify the fields in question.

If that is not the case, please post code.

Regards,
Rod
0
 

Author Comment

by:Lalitha_Ramalingam
ID: 13791391
Thanks for responding quickly.  The following is my code that I have now.

SP.asp is a page where I have the code to call the Stored Procedures.

<p><h4><i><font color = "Red">When you are done updating the table please click on.</i></font></h4></p>
<form method="post" id=form1 name=form1 action="SP.asp" >
<input name="Submit" type="Submit"></form>
<br>

<SCRIPT Language="JAVASCRIPT">
function EmailValidate()
{
     if (confirm("Are you sure? This will send Email to all customers!!!"))
     {
          return true;
     }
     else
     {
          return false;
     }
}
</SCRIPT>


<%
dim Letters
cars=Request.Form("Letters")
%>
<form action="Letters_radio.asp" method="post">
<p><font color = "Green">Please choose the letter you want to send:</font></p>

<input type="radio" name="Letters"
<%if Letters="AB" then Response.Write("checked")%>
value="Check">AB</input>
<br />
<input type="radio" name="letters"
<%if Letters="General " then Response.Write("checked")%>
value="Check">General </input>
<br />
<br /><br />
</form>


<form method="post" id=form1 name=form1 action="SP4.asp" OnSubmit ="return EmailValidate()" >
<input name="Submit" type="Submit" value ="Send Email"></form>
<br>

Thank you very much.

Regards,
Lalitha

0
 
LVL 29

Accepted Solution

by:
rdivilbiss earned 200 total points
ID: 13793314
Yes.  I don't see why you would need to disable the other form elements as when you click the first button you are posting to another page....however, if there is some delay in the other page loading and you are afraid they would click something else in the mean time, you can disable those with JavaScript...

Change: <form method="post" id=form1 name=form1 action="SP.asp" >

to: <form method="post" id=form1 name=form1 action="SP.asp" onsubmit="return submitSP();">

AND
Change: <input name="Submit" type="Submit" value ="Send Email">

to: <input id="subEmail" name="Submit" type="Submit" value ="Send Email">

Now add

function submitSP() {
  document.getElementById('subEmail').value='Please Wait';
  document.getElementById('subEmail').disabled=true;
  return true;
}

This will disable the second submit button to prevent an inadvertant click.  If you want to disable the radio buttons (not necessary) just give them an ID and add them to the function, e.g. document.getElementById('radio1').disabled=true;

Since you are posting to SP.asp, when you return the form will be in its original state.

BTW, you do not need multiple forms....

your buttons tell you what action to take, so one form with one action will do...you can use javascript to change the form action depending on which button was clicked.  But that is another question.

Good luck,
Rod

0
 

Author Comment

by:Lalitha_Ramalingam
ID: 13793358
Thanks a lot!!  it worked and I will keep your suggestion in mind about the multiple forms.  
0
 
LVL 29

Expert Comment

by:rdivilbiss
ID: 13793440
Glad I good help.

Good luck with your project
Rod
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question