Copy link to clipboard
Copied
Sir / Madam,
I am making a form in which i want a field in which when i click once it should show "+", when clicked twice it shows "-" and so on..............
Copy link to clipboard
Copied
What does "and so on" mean? What should happen if it's clicked a third time?
Copy link to clipboard
Copied
it should toggle between different characters i want...
like if i have 10 different characters.. then it should toggle between 10 of them.. while clicking on them.
Like on first click 1st character , second click 2nd character.. .till 10th and after that blank and again.... 1st character..
Copy link to clipboard
Copied
I have solved it by hiding/showing the the fields by clicking it... but that is very time consuming... i have to making as many boxes and then in each of them i have to do hide/show stuff..... very time consuming.. i want a javascript .
Copy link to clipboard
Copied
Here's a link to a sample form that demonstrates the type of behavior you're looking for: http://acroscript.net/pdf/demos/multistate_4.pdf
It is intended to function as a multistate check box, so it includes a text field so you can get the value of the composite field (button + text) like you can with other field types. You'll have to study the JavaScript to see how it works. The text fields that hold the value would normally be set to hidden.
Copy link to clipboard
Copied
Thank you Mr. George... this is exactly what i want... but i don't want so many fields to accomplish it...
I just want a text field or action button in which i can code a certain javascript to do it... bcoz i have atleast 500 checkboxes .. it will be very time taking .. if i follow. your method.... or show/hide field method.
Copy link to clipboard
Copied
It's possible to make it simpler using just buttons for each fake checkbox, but I don't have a demonstration of that. The basics of the coding is in the sample though. To create that many buttons and set them up with a script, I'd use JavaScript to create the buttons and set up the script in the Mouse Up event, like you see in that sample. Have you done much scripting in Acrobat?
Copy link to clipboard
Copied
sir ,
i have 500 checkboxes .. so i just want to make only 500 check boxes.. not more......plz suggest a way.. so that i can do it with 500 checkboxes...
i can even by a text box.... is it not possible in a text box..... .
Copy link to clipboard
Copied
Here, I wrote for you a code that will allow you to cycle through a list of any number of characters. You need to place it as the MouseUp event of your button field (and set the caption to the first item in the list):
var values = ["+", "-", "/", "*", "?", "!"]; // etc.
var currentSymbolIndex = values.indexOf(event.target.buttonGetCaption());
if (currentSymbolIndex==values.length-1)
event.target.buttonSetCaption(values[0]);
else event.target.buttonSetCaption(values[currentSymbolIndex+1]);
You can put that code in a function as a doc-level script and then just call it from each one of your fields. That way you can update the list in a single location and it will apply to all of them.
Copy link to clipboard
Copied
thanks for your reply... but i am not able to get it...
Copy link to clipboard
Copied
If you want help you need to provide more details. What exactly is the issue? Did you try running it? If so, what were the results?
Copy link to clipboard
Copied
Sir,
Thank you for the trouble u took for me.. but somehow . it is not working for me..........
i want you to see this other problem i am facing. .......plz click the link below
Copy link to clipboard
Copied
What does that request has to do with this one?
Copy link to clipboard
Copied
Actually i have completed the checkbox task by making 500 x 4 = 2000 checkboxes ...but now i have to make it non-editable when one submits it .... and the owner can again edit if necessary but only with password..
Copy link to clipboard
Copied
You need to set the fields as read-only and then prompt the user to enter the password using an app.response command.
Then, if the password is correct, loop other the fields once more and set the readonly property as false.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now