Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

website design planning

Status
Not open for further replies.

mfild

Technical User
Nov 1, 2003
22
0
0
GB
Hi,
If I need to add, delete, modify customers using dreamwever mx and a sql server 2000 do I need three separate pages. I have seen many examples in books that tend to show three different pages for this type of example. Is it possible to create one customer page that has three buttons on it (add, delete, modify) or do they need to be separate. My site will be intranet based and only used by internal staff. What is the advantage of creating the three separate pages? I have 12 tables in the database and they all need an add, delete, modify to them.

Thanks
 
mfild , hi, you do not need 3 different pages to accomplish this. The reason why most programmers might use 3 pages is to simplify things, especially when it comes time to update or debug the pages.

I've used this type of method with only 2 pages, but you can do it all on one page, depending on what kind of scripting you use. I used coldfusion for my application, and in CF (like most server-side codes) you can use a series of IF statements to activate the right portion when some criteria is satisfied.

What kind of scripting language will you be using?? Coldfusion?? ASP?? PHP??

Hope this helps.

[sub]
____________________________________
Just Imagine.
[sub]
 
Hi,

Thanks for the relpy, I am using ASP with Dreamweaver. After what you have said can the script be added to the Dreamweaver buttons? I am used to event handlers in programming but I can't see how this is done in Dreamweaver.

When you say you did it with 2 forms I imagine one is to input new data (customer for example) and the other is to get the records back with a modify and delete button on the same form. Is that right? If this is the case it would be a better solution.

Many thanks,

MFild

 
mfild, yes you can add the ASP code to the DW buttons. Since your going to be using even handelers, like 'onSubmit' or 'onClick' just call that function on that button. For example in JS, this is how we do it:

<script>
//this is the name of the function that will be called later on
function callme() {
//this checks if the fieldname is blank
if(document.formName.fieldName.value == &quot;&quot;) {
//if its blank, an alert is thrown
alert(&quot;Please enter something, then hit continue&quot;);
return false;
}
}
</script>

<form name=&quot;formName&quot; action=&quot;page2.asp&quot; method=&quot;post&quot; onSubmit=&quot;return callme();&quot;>
<input type=&quot;text&quot; name=&quot;fieldName&quot;><br><br>
<input type=&quot;submit&quot; name=&quot;submit&quot;>
</form>


As for your other question, page1 would have listed all the employees names, and information. Then the admin has the chance to either click the update link, or delete link. This will load page2, where the admin can either delete the employee or make some changes and submit them.

There are a lot of ways of doing this. But the 3-page technique is a lot simpler, because it isn't confusing to the users, and easy to maintain, in case of debgging.

[sub]
____________________________________
Just Imagine.
[sub]
 
Hi GUJUm0deL,

Thanks for your advice on this and good luck.

Regards,

MFild


 
its best for the developer to keep each seperate action / page in a seperate file. easier to find problems, easier to update, easier to think about. For 'fun' I built a 80K file CFML file that does all my product updates, additions, removals, and catagories including in\mage uploads and removals in a single file. sure it works perfectly, but i would never sell it to anyone like that. you could in fact, put your intire multi page web site into one file.

 
Hi imstillatwork,

I understand where you are coming from. With regards to procedures/functions I suppose you can put all of them on a single page in a separate file and call them as needed (naturally only ones you are going to use time and time again). Can you confirm this is the right way of doing it?

Many thanks,

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top