By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,722 Members | 1,174 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,722 IT Pros & Developers. It's quick & easy.

GUI for PHP?

P: n/a
Bob
Suggestions for a GUI for PHP?

Actually where I am heading with this is, occasionally I think a
thicker client would be called for than the typical browser interface.

What do you use?

Particularly the problem is I am doing a sales order entry form, and
I'd like to be able to add additional line items to the screen as
needed. The only way I can think to do it is to make a round trip to
the server, which I'd rather not do, or list or 10 or 20 blank form
lines for line item orders.

thanks
BobC
Jul 17 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Bob wrote:
Particularly the problem is I am doing a sales order entry form, and
I'd like to be able to add additional line items to the screen as
needed. The only way I can think to do it is to make a round trip to
the server, which I'd rather not do, or list or 10 or 20 blank form
lines for line item orders.


You could use javascript to build the order lines part of the form

Rick
Jul 17 '05 #2

P: n/a
*** Bob wrote/escribió (30 Sep 2004 07:16:30 -0700):
Suggestions for a GUI for PHP?
You have these:

PHP-GTK - http://gtk.php.net
WinBinder - http://winbinder.sourceforge.net/
Particularly the problem is I am doing a sales order entry form, and
I'd like to be able to add additional line items to the screen as
needed. The only way I can think to do it is to make a round trip to
the server, which I'd rather not do, or list or 10 or 20 blank form
lines for line item orders.


That's called DHTML (Dynamic HTML). It's a combination of JavaScript and
DOM (Document Object Model) and it's fairly common.
--
-- Álvaro G. Vicario - Burgos, Spain
-- Thank you for not e-mailing me your questions
--
Jul 17 '05 #3

P: n/a
Rick wrote:
Bob wrote:
Particularly the problem is I am doing a sales order entry form, and
I'd like to be able to add additional line items to the screen as
needed. The only way I can think to do it is to make a round trip to
the server, which I'd rather not do, or list or 10 or 20 blank form
lines for line item orders.


You could use javascript to build the order lines part of the form


I can see this working, each entry row would look something like this:

<tr>
<td><input type="text" size="4" name="quantity[]"></td>
<td><input type="text" size="35" name="item[]"></td>
<td><input type="text" size="4" name="price[]"></td>
</tr>

Then you could store that same string in a javascript variable. Make a
"Add another row" link that would fire the JS function to add the
additional row in the appropriate place.

Then when you process your form on the PHP side, you'd have;

Row 1:
quantity[0], item[0], price[0]
Row 2:
quantity[1], item[1], price[1]
....

<sarcasm>Makes for a lot of fun!</sarcasm>

The only thing you have to worry about then is that the client has JS
enabled, but by the sounds of it, you have some control on the
environment anyway.

--
Justin Koivisto - sp**@koivi.com
http://www.koivi.com
Jul 17 '05 #4

P: n/a
Ken
On Thu, 30 Sep 2004 14:44:59 GMT, Justin Koivisto <sp**@koivi.com>
wrote:

You could use javascript to build the order lines part of the form


I can see this working, each entry row would look something like this:

<tr>
<td><input type="text" size="4" name="quantity[]"></td>
<td><input type="text" size="35" name="item[]"></td>
<td><input type="text" size="4" name="price[]"></td>
</tr>

Then you could store that same string in a javascript variable. Make a
"Add another row" link that would fire the JS function to add the
additional row in the appropriate place.


When would you have it fire?

Ken
Jul 17 '05 #5

P: n/a
Ken scratched out in the sand
On Thu, 30 Sep 2004 14:44:59 GMT, Justin Koivisto <sp**@koivi.com>
wrote:

You could use javascript to build the order lines part of the form


I can see this working, each entry row would look something like this:

<tr>
<td><input type="text" size="4" name="quantity[]"></td>
<td><input type="text" size="35" name="item[]"></td>
<td><input type="text" size="4" name="price[]"></td>
</tr>

Then you could store that same string in a javascript variable. Make a
"Add another row" link that would fire the JS function to add the
additional row in the appropriate place.


When would you have it fire?


I've done this in both PHP and ASP. I cannot currently find my PHP code but
I have the ASP example. It allows for a new row to be entered by clicking a
button...

<input type="button" tabindex="11" value="Add Secondary APN"
onclick="addRow('tblBatch')" id=button1 name=button1>

....which fires off some javascript...
function addRow(id){
var tbody = document.getElementById(id).getElementsByTagName(" TBODY"
[0];
var row = document.createElement("TR");
var td1 = document.createElement("TD");
td1.align = 'right';
td1.appendChild(document.createTextNode("Secondary APN:"));
var td2 = document.createElement("TD");
td2.align = 'left';

var myinput = document.createElement("<INPUT name='txt2APNNo'
id='txt2APNNo' size='20' onBlur=validRequired(this,\"Secondary-APN\")>");
td2.appendChild(myinput);
row.appendChild(td1);
row.appendChild(td2);
tbody.appendChild(row);
myinput.focus();

}

...and adds an item to an array. You just then parse the array when you get
your form submitted. I even have an onBlur event to ensure that the new
field got filled-out before submitting.

This works fine in Netscape and IE.
--
kai - kai at 3gproductions dot com
www.gamephreakz.com || www.filesite.org
"friends don't let friends use windows xp"
Jul 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.