473,320 Members | 1,969 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

disabling the form elements

Hi all,

I have an issue here.
There is a link "My plan" in the php page1. On clicking this link directs to a form which has some entries that has to be filled by the user.And once the user fills the form and clicks the submit button the entries will be stored in the database.

What I need is, when the user fills the form and submits the form once all the form elements should be disabled. If the user again clicks the "My plan" link, the form elements should be disabled. I know that this can be done by recognizing the user_id, since this will be unique. But how exactly can I do this. Here is the code I am using,

test1.php
Expand|Select|Wrap|Line Numbers
  1. <body>
  2. <?php 
  3. $userid="45367";
  4. echo "<a href='test2.php?userid=$userid'>My plan</a>";
  5. ?>
  6. </body>
  7. </html>
test2.php
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <body>
  3. <?php
  4. $userid = $_GET['userid'];
  5. ?>
  6. <form name="form1" action="test3.php" method="post">
  7. Name : <input type="textbox" name="name">
  8. Age : <input type="textbox" name="age">
  9. Sex : <input type="checkbox" name="sex">
  10. <input type="submit" value="GO">
  11. </form>
  12. </body>
  13. </html>
Please help

WIth regards
Apr 4 '08 #1
1 1264
coolsti
310 100+
It is not really clear to me what you want to do here. Your test2.php is going to invoke the script test3.php and your user will then see whatever test3.php sends back to the browser as a response. If you want to echo the values that the user has inputted with test2.php, you can do it simply using other kinds of html tags rather than input tags. Or you could show them as the exact same input tags, but specify in the response of test3.php that these inputs are disabled, by adding the "disabled" keyword:

<input type="text" name="fieldname" value="fieldvalue" disabled />

You also might want test2.php to actually invoke test2.php again, with scripting to either show the input fields again to the user in the event the user did not enter something correctly, or if the fields were entered correctly, to perform the next step and show the user whatever test3.php would have shown.

Steve, Denmark
Apr 4 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Perttu Pulkkinen | last post by:
What si the best and MOST BROWSERCOMPATIBLE way of making elements disabled for the user? Also considering different kind of elements: textfields, selects, radiobuttons and textareas. This is what...
4
by: omidmottaghi | last post by:
I need to disable/enable form elements in my form. the code i was developed works fine in FF, but in IE, its behaviour is very strange!! in the form, we have a lot of checkboxes, all of them...
1
by: Jason Galvin | last post by:
I would like to disable the auto-populating feature (remembers form element text between post-backs) when creating a .NET form. I have succeeded in disabling auto-populate by creating my controls...
3
by: John Dalberg | last post by:
I have a webpage with a form. Depending on user selections at the top of the page, the page will disable sections of the form. My plan is to put each section between a <div></div>. Each section...
2
by: dougawells | last post by:
Hi- I'm wanting to have a set of radio buttons disabled when a form is displayed, then if they check another specific radio button, those would become enabled. I've tried setting it via...
11
by: shankwheat | last post by:
I have a function which passes text from txtdebt to debtsbox which works fine. However, I want to add code which examines the value of debtsbox and if any of the values the user entered contain the...
3
by: Sonnich | last post by:
Hi all! Say, I have <buttonor <input type="submit">, how do then disable them once they are clicked? I could not find the right thing on the net :-( S
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.